fix corner case in reduce_vars (#4384)

fixes #4383
This commit is contained in:
Alex Lam S.L
2020-12-16 20:47:48 +00:00
committed by GitHub
parent 8b10b93ee1
commit f68e267830
2 changed files with 33 additions and 4 deletions

View File

@@ -1844,3 +1844,25 @@ issue_4372_2: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_4383: {
options = {
evaluate: true,
reduce_vars: true,
unsafe: true,
}
input: {
console.log(function(a) {
[ a[0] ] = [];
return a.length;
}([]));
}
expect: {
console.log(function(a) {
[ a[0] ] = [];
return a.length;
}([]));
}
expect_stdout: "1"
node_version: ">=6"
}