Bug 1451172, fallback to current global in FindAssociatedGlobal when nsIGlobalObject doesn't have JS object anymore, r=bz

--HG--
extra : rebase_source : f5c520bd4019e6a8b940307355c68135e7e0cb9c
This commit is contained in:
Olli Pettay 2018-08-08 09:07:47 +03:00
parent 7786b357e9
commit b89a51dc36

View File

@ -1721,7 +1721,9 @@ FindAssociatedGlobal(JSContext* cx, nsIGlobalObject* const& p)
JSObject* global = p->GetGlobalJSObject();
if (!global) {
return nullptr;
// nsIGlobalObject doesn't have a JS object anymore,
// fallback to the current global.
return JS::CurrentGlobalOrNull(cx);
}
MOZ_ASSERT(JS_IsGlobalObject(global));