enhance reduce_vars (#3843)

This commit is contained in:
Alex Lam S.L
2020-05-03 15:52:43 +01:00
committed by GitHub
parent 3766d5c962
commit ac429dc8e1
3 changed files with 77 additions and 31 deletions

View File

@@ -6976,3 +6976,33 @@ issue_3774: {
}
expect_stdout: "PASS"
}
flatten_iife: {
options = {
reduce_vars: true,
side_effects: true,
toplevel: true,
unused: true,
}
input: {
var a = "FAIL";
while (!console);
a++;
(function() {
while (!console);
a = "PASS";
})();
console.log(a);
}
expect: {
var a;
while (!console);
0;
(function() {
while (!console);
a = "PASS";
})();
console.log(a);
}
expect_stdout: "PASS"
}