diff --git a/js/src/xpconnect/loader/mozJSComponentLoader.cpp b/js/src/xpconnect/loader/mozJSComponentLoader.cpp index 1d6b7d9e0998..ed2a7199180a 100644 --- a/js/src/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/src/xpconnect/loader/mozJSComponentLoader.cpp @@ -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; }