зеркало из https://github.com/mozilla/gecko-dev.git
Move code to finalize activation setup from ScriptRuntime to NativeCall not to depend in ScriptRuntime on internals of NativeCall
This commit is contained in:
Родитель
e555ebca97
Коммит
f689d29f4a
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче