This commit is contained in:
nboyd%atg.com 2001-06-14 17:37:18 +00:00
Родитель 3839438668
Коммит 374c7af66a
3 изменённых файлов: 25 добавлений и 23 удалений

Просмотреть файл

@ -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() {