mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1001198 - Stop firing onNewGlobalObject for the SafeJSContext global. r=gabor
This commit is contained in:
parent
648f667734
commit
f54ff48188
@ -173,6 +173,13 @@ XPCJSContextStack::InitSafeJSContext()
|
||||
|
||||
JS_SetErrorReporter(mSafeJSContext, xpc::SystemErrorReporter);
|
||||
|
||||
// Note - We intentionally avoid firing OnNewGlobalObject while
|
||||
// simultaneously skipping the call to setInvisibleToDebugger(true) here.
|
||||
// This lets us piggy-back on the assertions in the JS engine (which make
|
||||
// sure that, for non-invisible globals, we always fire onNewGlobalObject
|
||||
// before creating scripts), to assert that we never create scripts with
|
||||
// the SafeJSContextGlobal. This is all happening way before anyone could be
|
||||
// listening for debugger notifications anyway.
|
||||
JS::CompartmentOptions options;
|
||||
options.setZone(JS::SystemZone)
|
||||
.setTrace(TraceXPCGlobal);
|
||||
@ -194,8 +201,5 @@ XPCJSContextStack::InitSafeJSContext()
|
||||
if (NS_FAILED(xpc->InitClasses(mSafeJSContext, mSafeJSContextGlobal)))
|
||||
MOZ_CRASH();
|
||||
|
||||
JS::RootedObject glob(mSafeJSContext, mSafeJSContextGlobal);
|
||||
JS_FireOnNewGlobalObject(mSafeJSContext, glob);
|
||||
|
||||
return mSafeJSContext;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user