fix corner case in evaluate (#3938)

fixes #3937
This commit is contained in:
Alex Lam S.L
2020-05-30 11:22:40 +01:00
committed by GitHub
parent 43498769f0
commit 0eb4577a82
2 changed files with 22 additions and 1 deletions

View File

@@ -2669,3 +2669,24 @@ issue_3935: {
}
expect_stdout: "NaN"
}
issue_3937: {
options = {
conditionals: true,
evaluate: true,
reduce_vars: true,
toplevel: true,
unsafe: true,
}
input: {
var a = 123;
(a++ + (b = a))[b] ? 0 ? a : b : 0 ? a : b;
console.log(a, b);
}
expect: {
var a = 123;
(a++ + (b = a))[b], 0, b;
console.log(a, b);
}
expect_stdout: "124 124"
}