fix corner case in unused (#4557)

fixes #4556
This commit is contained in:
Alex Lam S.L
2021-01-15 04:33:17 +00:00
committed by GitHub
parent 65d39a3702
commit 18dbceb36f
2 changed files with 23 additions and 0 deletions

View File

@@ -826,3 +826,23 @@ issue_4363: {
expect_stdout: "PASS"
node_version: ">=8"
}
issue_4556: {
options = {
reduce_vars: true,
unused: true,
}
input: {
console.log(function() {
var a = "" + [ a++ ];
var b = [ ...a ];
}());
}
expect: {
console.log(function() {
var a;
}());
}
expect_stdout: "undefined"
node_version: ">=6"
}