mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 455633 - Protect against the weird Sandbox global object case when creating XPCNativeWrappers. r+sr=bzbarsky
This commit is contained in:
parent
76e8be0e68
commit
d9dc5056dc
@ -778,9 +778,14 @@ MirrorWrappedNativeParent(JSContext *cx, XPCWrappedNative *wrapper,
|
||||
XPCWrappedNative *parent_wrapper =
|
||||
XPCWrappedNative::GetWrappedNativeOfJSObject(cx, wn_parent);
|
||||
|
||||
*result = XPCNativeWrapper::GetNewOrUsed(cx, parent_wrapper, nsnull);
|
||||
if (!*result)
|
||||
return JS_FALSE;
|
||||
// parent_wrapper can be null if we're in a Components.utils.evalInSandbox
|
||||
// scope. In that case, the best we can do is just use the
|
||||
// non-native-wrapped sandbox global object for our parent.
|
||||
if (parent_wrapper) {
|
||||
*result = XPCNativeWrapper::GetNewOrUsed(cx, parent_wrapper, nsnull);
|
||||
if (!*result)
|
||||
return JS_FALSE;
|
||||
}
|
||||
}
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user