fix corner case in reduce_vars (#3895)

fixes #3894
This commit is contained in:
Alex Lam S.L
2020-05-13 16:44:54 +01:00
committed by GitHub
parent 30ed8f5580
commit fe2f1965d6
2 changed files with 33 additions and 0 deletions

View File

@@ -7068,3 +7068,30 @@ issue_3880: {
}
expect_stdout: "PASS"
}
issue_3894: {
options = {
collapse_vars: true,
inline: true,
reduce_vars: true,
unused: true,
}
input: {
function log(msg) {
console.log(msg ? "FAIL" : "PASS");
}
var a;
(function(b) {
a = 0,
log(b);
})(-0);
}
expect: {
function log(msg) {
console.log(msg ? "FAIL" : "PASS");
}
var a;
void log(-(a = 0));
}
expect_stdout: "PASS"
}