зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 8031242fe5e5 (bug 1165486)
This commit is contained in:
Родитель
8b7645f328
Коммит
ad62dcd1c9
|
@ -1788,7 +1788,8 @@ nsMessageManagerScriptExecutor::TryCacheLoadAndCompileScript(
|
|||
}
|
||||
} else {
|
||||
// We're going to run these against some non-global scope.
|
||||
if (!JS::CompileForNonSyntacticScope(cx, options, srcBuf, &script)) {
|
||||
options.setHasPollutedScope(true);
|
||||
if (!JS::Compile(cx, options, srcBuf, &script)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,10 +146,8 @@ PrepareScript(nsIURI* uri,
|
|||
}
|
||||
|
||||
if (!reuseGlobal) {
|
||||
if (JS_IsGlobalObject(targetObj))
|
||||
JS::Compile(cx, options, srcBuf, script);
|
||||
else
|
||||
JS::CompileForNonSyntacticScope(cx, options, srcBuf, script);
|
||||
options.setHasPollutedScope(!JS_IsGlobalObject(targetObj));
|
||||
JS::Compile(cx, options, srcBuf, script);
|
||||
} else {
|
||||
AutoObjectVector scopeChain(cx);
|
||||
if (!JS_IsGlobalObject(targetObj) &&
|
||||
|
@ -164,11 +162,9 @@ PrepareScript(nsIURI* uri,
|
|||
// We only use lazy source when no special encoding is specified because
|
||||
// the lazy source loader doesn't know the encoding.
|
||||
if (!reuseGlobal) {
|
||||
options.setSourceIsLazy(true);
|
||||
if (JS_IsGlobalObject(targetObj))
|
||||
JS::Compile(cx, options, buf, len, script);
|
||||
else
|
||||
JS::CompileForNonSyntacticScope(cx, options, buf, len, script);
|
||||
options.setSourceIsLazy(true)
|
||||
.setHasPollutedScope(!JS_IsGlobalObject(targetObj));
|
||||
JS::Compile(cx, options, buf, len, script);
|
||||
} else {
|
||||
AutoObjectVector scopeChain(cx);
|
||||
if (!JS_IsGlobalObject(targetObj) &&
|
||||
|
|
Загрузка…
Ссылка в новой задаче