fix corner case in arguments (#4609)

fixes #4608
This commit is contained in:
Alex Lam S.L
2021-02-02 15:07:31 +00:00
committed by GitHub
parent 7110c6923b
commit 3c556b8689
3 changed files with 51 additions and 10 deletions

View File

@@ -2514,3 +2514,45 @@ issue_4584: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_4608_1: {
options = {
arguments: true,
keep_fargs: false,
}
input: {
(function() {
[ arguments ] = [ "foo" ];
console.log(arguments[0]);
})();
}
expect: {
(function() {
[ arguments ] = [ "foo" ];
console.log(arguments[0]);
})();
}
expect_stdout: "f"
node_version: ">=6"
}
issue_4608_2: {
options = {
arguments: true,
reduce_vars: true,
}
input: {
(function(a) {
[ arguments ] = [ "foo" ];
console.log(arguments[0]);
})();
}
expect: {
(function(a) {
[ arguments ] = [ "foo" ];
console.log(arguments[0]);
})();
}
expect_stdout: "f"
node_version: ">=6"
}