fix corner case in loops & unused (#4085)

fixes #4084
This commit is contained in:
Alex Lam S.L
2020-09-01 20:20:58 +01:00
committed by GitHub
parent e33c727e8b
commit da8d154571
2 changed files with 29 additions and 1 deletions

View File

@@ -1009,3 +1009,31 @@ issue_4082: {
}
expect_stdout: "PASS"
}
issue_4084: {
options = {
keep_fargs: "strict",
loops: true,
reduce_vars: true,
unused: true,
}
input: {
console.log(function() {
function f(a) {
var b = a++;
for (a in "foo");
}
f();
return typeof a;
}());
}
expect: {
console.log(function() {
(function() {
0;
})();
return typeof a;
}());
}
expect_stdout: "undefined"
}