Bug 737780: fix compartments in nsFrameScriptExecutor::LoadFrameScriptInternal, r=luke

This commit is contained in:
David Mandelin 2012-04-02 19:09:34 -07:00
parent 517f27753a
commit 535c2cacfb

View File

@ -811,7 +811,8 @@ nsFrameScriptExecutor::LoadFrameScriptInternal(const nsAString& aURL)
JSAutoRequest ar(mCx);
JSObject* global = nsnull;
mGlobal->GetJSObject(&global);
if (global) {
JSAutoEnterCompartment ac;
if (global && ac.enter(mCx, global)) {
uint32 oldopts = JS_GetOptions(mCx);
JS_SetOptions(mCx, oldopts | JSOPTION_NO_SCRIPT_RVAL);