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; }