fix corner case in side_effects (#3984)

fixes #3983
This commit is contained in:
Alex Lam S.L
2020-06-10 12:30:37 +01:00
committed by GitHub
parent 2a9d0fc6fb
commit 1dbf7d4a3a
2 changed files with 33 additions and 3 deletions

View File

@@ -297,3 +297,33 @@ operator_in: {
}
expect_stdout: "PASS"
}
issue_3983: {
options = {
collapse_vars: true,
conditionals: true,
evaluate: true,
inline: true,
reduce_vars: true,
side_effects: true,
toplevel: true,
unused: true,
}
input: {
var a = "PASS";
function f() {
g && g();
}
f();
function g() {
0 ? a : 0;
}
var b = a;
console.log(a);
}
expect: {
var a = "PASS";
console.log(a);
}
expect_stdout: "PASS"
}