fix: null out thisArg only when constructing
This commit is contained in:
parent
78af69ec80
commit
bd548c813a
@ -14,7 +14,6 @@ public final class CodeFunction extends FunctionValue {
|
|||||||
public Value argsVal;
|
public Value argsVal;
|
||||||
|
|
||||||
private Value onCall(Frame frame) {
|
private Value onCall(Frame frame) {
|
||||||
if (mustCallSuper) frame.self = null;
|
|
||||||
frame.onPush();
|
frame.onPush();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -32,6 +31,7 @@ public final class CodeFunction extends FunctionValue {
|
|||||||
var frame = new Frame(env, isNew, thisArg, args, this);
|
var frame = new Frame(env, isNew, thisArg, args, this);
|
||||||
if (argsVal != null) frame.fakeArgs = argsVal;
|
if (argsVal != null) frame.fakeArgs = argsVal;
|
||||||
if (self != null) frame.self = self;
|
if (self != null) frame.self = self;
|
||||||
|
if (mustCallSuper && isNew) frame.self = null;
|
||||||
|
|
||||||
var res = onCall(frame);
|
var res = onCall(frame);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user