fix corner case in unused (#4185)

fixes #4184
This commit is contained in:
Alex Lam S.L
2020-10-05 11:59:03 +01:00
committed by GitHub
parent b7a57fc69d
commit b91a2459c0
2 changed files with 38 additions and 1 deletions

View File

@@ -3055,3 +3055,33 @@ single_use_catch_redefined: {
}
expect_stdout: true
}
issue_4184: {
options = {
reduce_vars: true,
unused: true,
}
input: {
(function() {
var a = function() {}, b = [ a, 1 && b, a = {} ];
try {
throw 42;
} catch (a) {
{
console.log(a);
}
}
})();
}
expect: {
(function() {
var b = [ function() {}, 1 && b, {} ];
try {
throw 42;
} catch (a) {
console.log(a);
}
})();
}
expect_stdout: "42"
}