mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 1718529 - Part 1: Use JS_ExecuteScript instead of JS::CloneAndExecuteScript when same-realm is guaranteed. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D121255
This commit is contained in:
parent
e19e94bc52
commit
5e5fb9a749
@ -872,7 +872,7 @@ nsresult mozJSComponentLoader::ObjectForLocation(
|
||||
bool executeOk = false;
|
||||
if (JS_IsGlobalObject(obj)) {
|
||||
JS::RootedValue rval(cx);
|
||||
executeOk = JS::CloneAndExecuteScript(aescx, script, &rval);
|
||||
executeOk = JS_ExecuteScript(aescx, script, &rval);
|
||||
} else {
|
||||
executeOk = JS::ExecuteInJSMEnvironment(aescx, script, obj);
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ static bool EvalStencil(JSContext* cx, HandleObject targetObj,
|
||||
}
|
||||
|
||||
if (JS_IsGlobalObject(targetObj)) {
|
||||
if (!JS::CloneAndExecuteScript(cx, script, retval)) {
|
||||
if (!JS_ExecuteScript(cx, script, retval)) {
|
||||
return false;
|
||||
}
|
||||
} else if (JS::IsJSMEnvironment(targetObj)) {
|
||||
@ -165,11 +165,11 @@ static bool EvalStencil(JSContext* cx, HandleObject targetObj,
|
||||
!mozJSComponentLoader::Get()->IsLoaderGlobal(targetGlobal),
|
||||
"Don't load subscript into target in a shared-global JSM");
|
||||
#endif
|
||||
if (!JS::CloneAndExecuteScript(cx, envChain, script, retval)) {
|
||||
if (!JS_ExecuteScript(cx, envChain, script, retval)) {
|
||||
return false;
|
||||
}
|
||||
} else if (JS_IsGlobalObject(loadScope)) {
|
||||
if (!JS::CloneAndExecuteScript(cx, envChain, script, retval)) {
|
||||
if (!JS_ExecuteScript(cx, envChain, script, retval)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user