зеркало из https://github.com/mozilla/pjs.git
I removed InterpretedFunction.itsClosure as it was effectively used only itsClosure != null test and the effect can be done via setting InterpretedFunction.useDynamicScope to false.
This commit is contained in:
Родитель
4b0f00697f
Коммит
f4cfc98e4d
|
@ -62,7 +62,6 @@ final class InterpretedFunction extends NativeFunction
|
|||
}
|
||||
|
||||
InterpreterData itsData;
|
||||
Scriptable itsClosure;
|
||||
boolean itsUseDynamicScope;
|
||||
}
|
||||
|
||||
|
|
|
@ -1598,9 +1598,7 @@ public class Interpreter {
|
|||
|
||||
if (idata.itsFunctionType != 0) {
|
||||
InterpretedFunction f = (InterpretedFunction)fnOrScript;
|
||||
if (f.itsClosure != null) {
|
||||
scope = f.itsClosure;
|
||||
} else if (!f.itsUseDynamicScope) {
|
||||
if (!f.itsUseDynamicScope) {
|
||||
scope = fnOrScript.getParentScope();
|
||||
}
|
||||
|
||||
|
@ -2442,7 +2440,7 @@ public class Interpreter {
|
|||
InterpreterData closureData = idata.itsNestedFunctions[i];
|
||||
InterpretedFunction closure = createFunction(cx, scope, closureData,
|
||||
idata.itsFromEvalCode);
|
||||
closure.itsClosure = scope;
|
||||
closure.itsUseDynamicScope = false;
|
||||
stack[++stackTop] = closure;
|
||||
pc += 2;
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче