fix corner case in arguments (#4201)

fixes #4200
This commit is contained in:
Alex Lam S.L
2020-10-12 12:03:21 +01:00
committed by GitHub
parent 1cdf810f0b
commit 00d0eda85b
2 changed files with 25 additions and 0 deletions

View File

@@ -9180,6 +9180,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"
}