mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-12 09:01:16 +00:00
Bug 590346 - TM: Global Object created in GlobalForLocation needs its own compartment r=mrbkap
This commit is contained in:
parent
47ff97dc65
commit
225ac41a79
@ -1219,6 +1219,10 @@ mozJSComponentLoader::GlobalForLocation(nsILocalFile *aComponentFile,
|
||||
rv = holder->GetJSObject(&global);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
JSAutoCrossCompartmentCall ac;
|
||||
if (!ac.enter(cx, global))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (!JS_DefineFunctions(cx, global, gGlobalFun)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user