Move code to finalize activation setup from ScriptRuntime to NativeCall not to depend in ScriptRuntime on internals of NativeCall

This commit is contained in:
igor%mir2.org 2002-04-11 09:15:44 +00:00
Родитель e555ebca97
Коммит f689d29f4a
2 изменённых файлов: 8 добавлений и 10 удалений

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

@ -78,6 +78,12 @@ public final class NativeCall extends IdScriptable {
// initialize "arguments" property
super.put("arguments", this, new Arguments(this));
if (argNames != null) {
for (int i = funObj.argCount; i != argNames.length; i++) {
super.put(argNames[i], this, Undefined.instance);
}
}
}
private NativeCall() {
@ -164,7 +170,7 @@ public final class NativeCall extends IdScriptable {
NativeCall caller;
NativeFunction funObj;
Scriptable thisObj;
Object[] originalArgs;
private Object[] originalArgs;
public int debugPC;
private boolean prototypeFlag;

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

@ -1908,15 +1908,7 @@ public class ScriptRuntime {
NativeFunction funObj,
Scriptable thisObj, Object[] args)
{
NativeCall result = new NativeCall(cx, scope, funObj, thisObj, args);
String[] argNames = funObj.argNames;
if (argNames != null) {
for (int i = funObj.argCount; i != argNames.length; i++) {
String name = argNames[i];
result.put(name, result, Undefined.instance);
}
}
return result;
return new NativeCall(cx, scope, funObj, thisObj, args);
}
public static void popActivation(Context cx) {