fix corner case in unused (#3747)

fixes #3746
This commit is contained in:
Alex Lam S.L
2020-03-06 18:27:42 +00:00
committed by GitHub
parent bdc8ef2218
commit 421bb7083a
2 changed files with 41 additions and 6 deletions

View File

@@ -2413,3 +2413,34 @@ issue_3673: {
}
expect_stdout: "PASS"
}
issue_3746: {
options = {
keep_fargs: "strict",
side_effects: true,
unused: true,
}
input: {
try {
A;
} catch (e) {
var e;
}
(function f(a) {
e = a;
})();
console.log("PASS");
}
expect: {
try {
A;
} catch (e) {
var e;
}
(function(a) {
e = a;
})();
console.log("PASS");
}
expect_stdout: "PASS"
}