mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 979481 - Don't depend on the default global for the SafeJSContext in nsJSUtils::ReportPendingException. r=bz
This commit is contained in:
parent
2eb7cd279e
commit
ed41a09c4d
@ -120,6 +120,12 @@ nsJSUtils::ReportPendingException(JSContext *aContext)
|
||||
JS::Rooted<JSObject*> scope(aContext);
|
||||
scope = scx ? scx->GetWindowProxy()
|
||||
: js::DefaultObjectForContextOrNull(aContext);
|
||||
if (!scope) {
|
||||
// The SafeJSContext has no default object associated with it.
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(aContext == nsContentUtils::GetSafeJSContext());
|
||||
scope = xpc::GetSafeJSContextGlobal();
|
||||
}
|
||||
JSAutoCompartment ac(aContext, scope);
|
||||
JS_ReportPendingException(aContext);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user