fix corner cases in reduce_vars & unused (#3955)

fixes #3953
fixes #3956
fixes #3957
This commit is contained in:
Alex Lam S.L
2020-06-05 11:51:21 +01:00
committed by GitHub
parent fbc9d8009b
commit eb481cee8c
4 changed files with 124 additions and 10 deletions

View File

@@ -2715,3 +2715,23 @@ issue_3944: {
}
expect_stdout: "false"
}
issue_3953: {
options = {
evaluate: true,
reduce_vars: true,
}
input: {
function f(a) {
(a += 0 * (a = 0)) && console.log("PASS");
}
f(1);
}
expect: {
function f(a) {
(a += 0 * (a = 0)) && console.log("PASS");
}
f(1);
}
expect_stdout: "PASS"
}