зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1145294. Remove the obj argument from JS::CloneAndExecuteScript. r=luke
This commit is contained in:
Родитель
e41b92481e
Коммит
9fb24e2658
|
@ -1557,7 +1557,7 @@ nsMessageManagerScriptExecutor::LoadScriptInternal(const nsAString& aURL,
|
|||
JSContext* cx = aes.cx();
|
||||
if (script) {
|
||||
if (aRunInGlobalScope) {
|
||||
JS::CloneAndExecuteScript(cx, global, script);
|
||||
JS::CloneAndExecuteScript(cx, script);
|
||||
} else {
|
||||
JS::Rooted<JSObject*> scope(cx);
|
||||
bool ok = js::ExecuteInGlobalAndReturnScope(cx, global, script, &scope);
|
||||
|
|
|
@ -3581,7 +3581,7 @@ XULDocument::ExecuteScript(nsXULPrototypeScript *aScript)
|
|||
// The script is in the compilation scope. Clone it into the target scope
|
||||
// and execute it. On failure, ~AutoScriptEntry will handle exceptions, so
|
||||
// there is no need to manually check the return value.
|
||||
JS::CloneAndExecuteScript(cx, global, scriptObject);
|
||||
JS::CloneAndExecuteScript(cx, scriptObject);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -2363,7 +2363,7 @@ ShellCloneAndExecuteScript(JSContext *cx, unsigned argc, Value *vp)
|
|||
|
||||
AutoCompartment ac(cx, global);
|
||||
|
||||
if (!JS::CloneAndExecuteScript(cx, global, script))
|
||||
if (!JS::CloneAndExecuteScript(cx, script))
|
||||
return false;
|
||||
|
||||
args.rval().setUndefined();
|
||||
|
|
|
@ -4141,21 +4141,18 @@ JS_ExecuteScript(JSContext *cx, AutoObjectVector &scopeChain, HandleScript scrip
|
|||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS::CloneAndExecuteScript(JSContext *cx, HandleObject obj, HandleScript scriptArg)
|
||||
JS::CloneAndExecuteScript(JSContext *cx, HandleScript scriptArg)
|
||||
{
|
||||
CHECK_REQUEST(cx);
|
||||
assertSameCompartment(cx, obj);
|
||||
RootedScript script(cx, scriptArg);
|
||||
if (script->compartment() != cx->compartment()) {
|
||||
PollutedGlobalScopeOption globalScopeOption = obj->is<GlobalObject>() ?
|
||||
HasCleanGlobalScope : HasPollutedGlobalScope;
|
||||
script = CloneScript(cx, NullPtr(), NullPtr(), script, globalScopeOption);
|
||||
script = CloneScript(cx, NullPtr(), NullPtr(), script);
|
||||
if (!script)
|
||||
return false;
|
||||
|
||||
js::Debugger::onNewScript(cx, script);
|
||||
}
|
||||
return ExecuteScript(cx, obj, script, nullptr);
|
||||
return ExecuteScript(cx, cx->global(), script, nullptr);
|
||||
}
|
||||
|
||||
static const unsigned LARGE_SCRIPT_LENGTH = 500*1024;
|
||||
|
|
|
@ -3748,7 +3748,7 @@ namespace JS {
|
|||
* cross-compartment, it is cloned into the current compartment before executing.
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
CloneAndExecuteScript(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<JSScript*> script);
|
||||
CloneAndExecuteScript(JSContext *cx, JS::Handle<JSScript*> script);
|
||||
|
||||
} /* namespace JS */
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче