fix corner cases with rest parameters (#4526)

fixes #4525
This commit is contained in:
Alex Lam S.L
2021-01-09 00:38:51 +00:00
committed by GitHub
parent 553034fe52
commit 770f3ba5fe
2 changed files with 44 additions and 2 deletions

View File

@@ -485,3 +485,43 @@ keep_arguments: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_4525_1: {
options = {
arguments: true,
}
input: {
console.log(function(a, ...[]) {
a = "FAIL";
return arguments[0];
}("PASS"));
}
expect: {
console.log(function(a, ...[]) {
a = "FAIL";
return arguments[0];
}("PASS"));
}
expect_stdout: "PASS"
node_version: ">=6"
}
issue_4525_2: {
options = {
unused: true,
}
input: {
console.log(function(a, ...[]) {
a = "FAIL";
return arguments[0];
}("PASS"));
}
expect: {
console.log(function(a, ...[]) {
a = "FAIL";
return arguments[0];
}("PASS"));
}
expect_stdout: "PASS"
node_version: ">=6"
}