mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 03:24:26 +00:00
Bug 981218 - Stop using default compartment objects in nsJSUtils.cpp. r=bobowen
This commit is contained in:
parent
43e0dc6c0c
commit
3072f32a30
@ -103,8 +103,7 @@ nsJSUtils::ReportPendingException(JSContext *aContext)
|
||||
// otherwise default global) of aContext, so use that here.
|
||||
nsIScriptContext* scx = GetScriptContextFromJSContext(aContext);
|
||||
JS::Rooted<JSObject*> scope(aContext);
|
||||
scope = scx ? scx->GetWindowProxy()
|
||||
: js::DefaultObjectForContextOrNull(aContext);
|
||||
scope = scx ? scx->GetWindowProxy() : nullptr;
|
||||
if (!scope) {
|
||||
// The SafeJSContext has no default object associated with it.
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
@ -319,8 +318,5 @@ JSObject* GetDefaultScopeFromJSContext(JSContext *cx)
|
||||
// the cx, so in those cases we need to fetch it via the scx
|
||||
// instead.
|
||||
nsIScriptContext *scx = GetScriptContextFromJSContext(cx);
|
||||
if (scx) {
|
||||
return scx->GetWindowProxy();
|
||||
}
|
||||
return js::DefaultObjectForContextOrNull(cx);
|
||||
return scx ? scx->GetWindowProxy() : nullptr;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user