зеркало из https://github.com/mozilla/gecko-dev.git
Fix bug 85880
This commit is contained in:
Родитель
3839438668
Коммит
374c7af66a
|
@ -81,9 +81,19 @@ class InterpretedFunction extends NativeFunction implements DebuggableScript {
|
|||
scope = itsClosure;
|
||||
else if (!itsData.itsUseDynamicScope)
|
||||
scope = getParentScope();
|
||||
if (itsData.itsNeedsActivation)
|
||||
|
||||
if (itsData.itsNeedsActivation) {
|
||||
scope = ScriptRuntime.initVarObj(cx, scope, this, thisObj, args);
|
||||
return Interpreter.interpret(cx, scope, thisObj, args, this, itsData);
|
||||
}
|
||||
try {
|
||||
return Interpreter.interpret(cx, scope, thisObj, args, this,
|
||||
itsData);
|
||||
}
|
||||
finally {
|
||||
if (itsData.itsNeedsActivation) {
|
||||
ScriptRuntime.popActivation(cx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isFunction() {
|
||||
|
|
|
@ -786,8 +786,8 @@ public class Interpreter extends LabelTable {
|
|||
iCodeTop = addByte((byte) TokenStream.ONE, iCodeTop);
|
||||
else {
|
||||
iCodeTop = addByte((byte) TokenStream.NUMBER, iCodeTop);
|
||||
iCodeTop = addNumber(num, iCodeTop);
|
||||
}
|
||||
iCodeTop = addNumber(num, iCodeTop);
|
||||
}
|
||||
}
|
||||
itsStackDepth++;
|
||||
if (itsStackDepth > itsData.itsMaxStack)
|
||||
|
@ -1722,9 +1722,6 @@ public class Interpreter extends LabelTable {
|
|||
stack[stackTop] = ScriptRuntime.call(cx, lhs, rhs,
|
||||
outArgs,
|
||||
calleeScope);
|
||||
if (theData.itsNeedsActivation) {
|
||||
ScriptRuntime.popActivation(cx);
|
||||
}
|
||||
pc += 4;
|
||||
break;
|
||||
case TokenStream.NEW :
|
||||
|
|
|
@ -54,7 +54,16 @@ public final class NativeCall extends IdScriptable {
|
|||
NativeCall(Context cx, Scriptable scope, NativeFunction funObj,
|
||||
Scriptable thisObj, Object[] args)
|
||||
{
|
||||
this(cx, scope, funObj, thisObj);
|
||||
this.funObj = funObj;
|
||||
this.thisObj = thisObj;
|
||||
|
||||
setParentScope(scope);
|
||||
// leave prototype null
|
||||
|
||||
// save current activation
|
||||
this.caller = cx.currentActivation;
|
||||
cx.currentActivation = this;
|
||||
|
||||
this.originalArgs = (args == null) ? ScriptRuntime.emptyArgs : args;
|
||||
|
||||
// initialize values of arguments
|
||||
|
@ -71,21 +80,7 @@ public final class NativeCall extends IdScriptable {
|
|||
super.put("arguments", this, new Arguments(this));
|
||||
}
|
||||
|
||||
NativeCall(Context cx, Scriptable scope, NativeFunction funObj,
|
||||
Scriptable thisObj)
|
||||
{
|
||||
this.funObj = funObj;
|
||||
this.thisObj = thisObj;
|
||||
|
||||
setParentScope(scope);
|
||||
// leave prototype null
|
||||
|
||||
// save current activation
|
||||
this.caller = cx.currentActivation;
|
||||
cx.currentActivation = this;
|
||||
}
|
||||
|
||||
NativeCall() {
|
||||
private NativeCall() {
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче