mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-24 16:54:08 +00:00
Bug 636251 - Use JSOPTION_NO_SCRIPT_RVAL in nsFrameMessageManager.cpp, r=jorendorff
This commit is contained in:
parent
f1fd210898
commit
6651b13d4e
@ -627,10 +627,9 @@ nsFrameScriptExecutor::LoadFrameScriptInternal(const nsAString& aURL)
|
||||
JSObject* global = nsnull;
|
||||
mGlobal->GetJSObject(&global);
|
||||
if (global) {
|
||||
jsval val;
|
||||
JS_ExecuteScript(mCx, global,
|
||||
(JSScript*)JS_GetPrivate(mCx, holder->mObject),
|
||||
&val);
|
||||
nsnull);
|
||||
}
|
||||
}
|
||||
JSContext* unused;
|
||||
@ -682,12 +681,18 @@ nsFrameScriptExecutor::LoadFrameScriptInternal(const nsAString& aURL)
|
||||
JSPrincipals* jsprin = nsnull;
|
||||
mPrincipal->GetJSPrincipals(mCx, &jsprin);
|
||||
nsContentUtils::XPConnect()->FlagSystemFilenamePrefix(url.get(), PR_TRUE);
|
||||
|
||||
uint32 oldopts = JS_GetOptions(mCx);
|
||||
JS_SetOptions(mCx, oldopts | JSOPTION_NO_SCRIPT_RVAL);
|
||||
|
||||
JSScript* script =
|
||||
JS_CompileUCScriptForPrincipals(mCx, nsnull, jsprin,
|
||||
(jschar*)dataString.get(),
|
||||
dataString.Length(),
|
||||
url.get(), 1);
|
||||
|
||||
JS_SetOptions(mCx, oldopts);
|
||||
|
||||
if (script) {
|
||||
JSObject* scriptObj = JS_NewScriptObject(mCx, script);
|
||||
JS_AddObjectRoot(mCx, &scriptObj);
|
||||
@ -702,9 +707,8 @@ nsFrameScriptExecutor::LoadFrameScriptInternal(const nsAString& aURL)
|
||||
"Cached message manager script");
|
||||
sCachedScripts->Put(aURL, holder);
|
||||
}
|
||||
jsval val;
|
||||
JS_ExecuteScript(mCx, global,
|
||||
(JSScript*)JS_GetPrivate(mCx, scriptObj), &val);
|
||||
(JSScript*)JS_GetPrivate(mCx, scriptObj), nsnull);
|
||||
JS_RemoveObjectRoot(mCx, &scriptObj);
|
||||
}
|
||||
//XXX Argh, JSPrincipals are manually refcounted!
|
||||
|
Loading…
Reference in New Issue
Block a user