diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 1efe9d425149..be44818df622 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -1392,6 +1392,7 @@ nsJSContext::ExecuteScript(JSScript* aScriptObject, nsJSContext::TerminationFuncHolder holder(this); XPCAutoRequest ar(mContext); + JSAutoCompartment ac(mContext, aScopeObject); ++mExecuteDepth; // The result of evaluation, used only if there were no errors. This need