mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 990293 - Pass false to WrapNative in nsIDocument::WrapObject. r=bz
This commit is contained in:
parent
56dc0c1f4b
commit
4d697fc708
@ -1650,9 +1650,10 @@ public:
|
||||
|
||||
MOZ_WARN_UNUSED_RESULT
|
||||
static nsresult WrapNative(JSContext *cx, nsISupports *native,
|
||||
const nsIID* aIID, JS::MutableHandle<JS::Value> vp)
|
||||
const nsIID* aIID, JS::MutableHandle<JS::Value> vp,
|
||||
bool aAllowWrapping = true)
|
||||
{
|
||||
return WrapNative(cx, native, nullptr, aIID, vp, true);
|
||||
return WrapNative(cx, native, nullptr, aIID, vp, aAllowWrapping);
|
||||
}
|
||||
|
||||
// Same as the WrapNative above, but use this one if aIID is nsISupports' IID.
|
||||
|
@ -12151,15 +12151,13 @@ nsIDocument::WrapObject(JSContext *aCx)
|
||||
|
||||
JS::Rooted<JS::Value> winVal(aCx);
|
||||
nsresult rv = nsContentUtils::WrapNative(aCx, win, &NS_GET_IID(nsIDOMWindow),
|
||||
&winVal);
|
||||
&winVal,
|
||||
false);
|
||||
if (NS_FAILED(rv)) {
|
||||
Throw(aCx, rv);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(&winVal.toObject() == js::UncheckedUnwrap(&winVal.toObject()),
|
||||
"WrapNative shouldn't create a cross-compartment wrapper");
|
||||
|
||||
NS_NAMED_LITERAL_STRING(doc_str, "document");
|
||||
|
||||
if (!JS_DefineUCProperty(aCx, JSVAL_TO_OBJECT(winVal), doc_str.get(),
|
||||
|
Loading…
Reference in New Issue
Block a user