js::UnwrapOneChecked(RawObject obj, bool stopAtOuter) { if (!obj->isWrapper() || JS_UNLIKELY(!!obj->getClass()->ext.innerObject && stopAtOuter)) { return obj; } Wrapper *handler = Wrapper::wrapperHandler(obj); return handler->isSafeToUnwrap() ? Wrapper::wrappedObject(obj) : NULL; }
js::UnwrapOneChecked(RawObject obj) { // Checked unwraps should never unwrap outer windows. if (!obj->isWrapper() || JS_UNLIKELY(!!obj->getClass()->ext.innerObject)) { return obj; } Wrapper *handler = Wrapper::wrapperHandler(obj); return handler->isSafeToUnwrap() ? Wrapper::wrappedObject(obj) : NULL; }
bool js::IsCrossCompartmentWrapper(RawObject wrapper) { return wrapper->isWrapper() && !!(Wrapper::wrapperHandler(wrapper)->flags() & Wrapper::CROSS_COMPARTMENT); }