Bug 1481229 part 1 - Remove unnecessary realm entering in JavaScriptShared::findObjectById. r=evilpie
ToWindowProxyIfWindow does not rely on the current realm in any way.
This commit is contained in:
@@ -538,11 +538,8 @@ JavaScriptShared::findObjectById(JSContext* cx, const ObjectId& objId)
|
||||
// wrappers.
|
||||
JSAutoRealm ar(cx, scopeForTargetObjects());
|
||||
if (objId.hasXrayWaiver()) {
|
||||
{
|
||||
JSAutoRealmAllowCCW ar2(cx, obj);
|
||||
obj = js::ToWindowProxyIfWindow(obj);
|
||||
MOZ_ASSERT(obj);
|
||||
}
|
||||
obj = js::ToWindowProxyIfWindow(obj);
|
||||
MOZ_ASSERT(obj);
|
||||
if (!xpc::WrapperFactory::WaiveXrayAndWrap(cx, &obj))
|
||||
return nullptr;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user