Bug 590346 - TM: Global Object created in GlobalForLocation needs its own compartment r=mrbkap

This commit is contained in:
Gregor Wagner 2010-08-27 07:49:31 -07:00
parent 47ff97dc65
commit 225ac41a79

View File

@ -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;
}