fix corner case in rests (#5129)

fixes #5128
This commit is contained in:
Alex Lam S.L
2021-09-19 22:02:35 +01:00
committed by GitHub
parent 85786889bd
commit 55418fd460
2 changed files with 43 additions and 0 deletions

View File

@@ -1109,3 +1109,45 @@ issue_5108: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5128_1: {
options = {
inline: true,
}
input: {
console.log(function() {
return function f(...[ a ]) {
return a;
}("PASS");
}());
}
expect: {
console.log(function f(...[ a ]) {
return a;
}("PASS"));
}
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5128_2: {
options = {
inline: true,
keep_fnames: true,
unused: true,
}
input: {
console.log(function() {
return function f(...[ a ]) {
return a;
}("PASS");
}());
}
expect: {
console.log(function f(...[ a ]) {
return a;
}("PASS"));
}
expect_stdout: "PASS"
node_version: ">=6"
}