fix corner case in reduce_vars (#3623)

fixes #3622
This commit is contained in:
Alex Lam S.L
2019-12-04 20:24:55 +08:00
committed by GitHub
parent 500e31e03b
commit d68ddc31f9
2 changed files with 31 additions and 1 deletions

View File

@@ -6774,3 +6774,30 @@ issue_3509: {
}
expect_stdout: "PASS"
}
issue_3622: {
options = {
evaluate: true,
inline: true,
keep_fargs: "strict",
reduce_vars: true,
sequences: true,
toplevel: true,
unused: true,
}
input: {
var c = "FAIL";
!function(b, a) {
a && (c = "PASS");
}(42, this);
console.log(c);
}
expect: {
var c = "FAIL";
var a;
a = this,
!void (a && (c = "PASS")),
console.log(c);
}
expect_stdout: "PASS"
}