fix corner case in reduce_vars (#3510)

fixes #3509
This commit is contained in:
Alex Lam S.L
2019-10-22 20:36:05 +08:00
committed by GitHub
parent 0b3705e82f
commit 02308a7b56
2 changed files with 29 additions and 3 deletions

View File

@@ -6752,3 +6752,31 @@ issue_3377: {
}
expect_stdout: "42"
}
issue_3509: {
options = {
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
function a() {
console.log("PASS");
}
try {
} catch (a) {
var a;
}
a();
}
expect: {
try {
} catch (a) {
var a;
}
(function() {
console.log("PASS");
})();
}
expect_stdout: "PASS"
}