fix corner case in evaluate (#3921)

fixes #3920
This commit is contained in:
Alex Lam S.L
2020-05-22 04:38:09 +01:00
committed by GitHub
parent 75c5b6029b
commit d1cc5270a3
2 changed files with 42 additions and 11 deletions

View File

@@ -2463,3 +2463,25 @@ issue_3905: {
}
expect_stdout: "0"
}
issue_3920: {
options = {
evaluate: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
var a = function(b) {
return (b[b = 0] = 0) >= (b ? 0 : 1);
}("foo");
console.log(a);
}
expect: {
var a = function(b) {
return (b[b = 0] = 0) >= (b ? 0 : 1);
}("foo");
console.log(a);
}
expect_stdout: "false"
}