fix corner case in arguments

fixes #4200
This commit is contained in:
alexlamsl 2020-10-12 13:07:31 +08:00
parent 9b7a13c8c7
commit de5d3c3e82
2 changed files with 25 additions and 0 deletions

View File

@ -9170,6 +9170,7 @@ merge(Compressor.prototype, {
var i = 0, p;
while (p = compressor.parent(i++)) {
if (p instanceof AST_Lambda) {
if (p instanceof AST_Accessor) return;
fn_parent = compressor.parent(i);
return p;
}

View File

@ -783,3 +783,27 @@ issue_3420_7: {
}
expect_stdout: "true"
}
issue_4200: {
options = {
arguments: true,
keep_fargs: false,
}
input: {
var o = {
get p() {
return arguments[0];
},
};
console.log(o.p);
}
expect: {
var o = {
get p() {
return arguments[0];
},
};
console.log(o.p);
}
expect_stdout: "undefined"
}