mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 831076 - Add assertSameCompartment to JS_ObjectToOuterObject, and clean up classinfo hook. r=mrbkap
This commit is contained in:
parent
e03bc92cec
commit
7f9ead0fc2
@ -6742,12 +6742,12 @@ nsWindowSH::OuterObject(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
||||
}
|
||||
|
||||
JSObject *winObj = win->FastGetGlobalJSObject();
|
||||
if (!winObj) {
|
||||
NS_ASSERTION(origWin->IsOuterWindow(), "What window is this?");
|
||||
*_retval = obj;
|
||||
return NS_OK;
|
||||
}
|
||||
MOZ_ASSERT(winObj);
|
||||
|
||||
// Note that while |wrapper| is same-compartment with cx, the outer window
|
||||
// might not be. If we're running script in an inactive scope and evalute
|
||||
// |this|, the outer window is actually a cross-compartment wrapper. So we
|
||||
// need to wrap here.
|
||||
if (!JS_WrapObject(cx, &winObj)) {
|
||||
*_retval = nullptr;
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
@ -105,6 +105,7 @@ JS_FRIEND_API(JSObject *)
|
||||
JS_ObjectToOuterObject(JSContext *cx, JSObject *obj_)
|
||||
{
|
||||
Rooted<JSObject*> obj(cx, obj_);
|
||||
assertSameCompartment(cx, obj);
|
||||
return GetOuterObject(cx, obj);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user