зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1097987 part 4. Change mozJSSubScriptLoader to use the scopechain version of JS_ExecuteScript as needed. r=bholley
This commit is contained in:
Родитель
0dbd99c459
Коммит
65cc333846
|
@ -378,7 +378,13 @@ mozJSSubScriptLoader::DoLoadSubScriptWithOptions(const nsAString &url,
|
|||
ok = JS_CallFunction(cx, targetObj, function, JS::HandleValueArray::empty(),
|
||||
retval);
|
||||
} else {
|
||||
ok = JS_ExecuteScript(cx, targetObj, script, retval);
|
||||
if (JS_IsGlobalObject(targetObj)) {
|
||||
ok = JS_ExecuteScript(cx, targetObj, script, retval);
|
||||
} else {
|
||||
JS::AutoObjectVector scopeChain(cx);
|
||||
ok = scopeChain.append(targetObj) &&
|
||||
JS_ExecuteScript(cx, scopeChain, script, retval);
|
||||
}
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче