enhance unused (#3794)

This commit is contained in:
Alex Lam S.L
2020-04-18 11:52:44 +01:00
committed by GitHub
parent b38838c6bf
commit 60d4e7b09f
6 changed files with 54 additions and 30 deletions

View File

@@ -2444,3 +2444,23 @@ issue_3746: {
}
expect_stdout: "PASS"
}
drop_duplicated_side_effects: {
options = {
toplevel: true,
unused: true,
}
input: {
var a = 0;
for (var i = 1; i--;)
var a = 0, b = ++a;
console.log(a);
}
expect: {
var a = 0;
for (var i = 1; i--;)
a = 0, ++a;
console.log(a);
}
expect_stdout: "1"
}