fix corner case in conditionals & side_effects (#4669)

fixes #4668
This commit is contained in:
Alex Lam S.L
2021-02-20 03:13:15 +00:00
committed by GitHub
parent 5f60c1b830
commit 8d668c2963
2 changed files with 35 additions and 7 deletions

View File

@@ -506,3 +506,34 @@ issue_4366_2: {
expect_stdout: "PASS"
node_version: ">=4"
}
issue_4668: {
options = {
conditionals: true,
keep_fargs: false,
keep_fnames: true,
reduce_vars: true,
side_effects: true,
toplevel: true,
unused: true,
}
input: {
function f(a) {
var b, c;
function g() {
return a = 0 + a, !d || (a = 0);
}
c = g();
}
console.log(f());
var d = 0;
}
expect: {
console.log(function f() {
(function g() {
0;
})();
}());
}
expect_stdout: "undefined"
}