fix corner case in unsafe evaluate (#3989)

fixes #3988
This commit is contained in:
Alex Lam S.L
2020-06-11 00:37:39 +01:00
committed by GitHub
parent 596fad182e
commit e89031f1af
2 changed files with 42 additions and 18 deletions

View File

@@ -2735,3 +2735,27 @@ issue_3953: {
}
expect_stdout: "PASS"
}
issue_3988: {
options = {
evaluate: true,
reduce_vars: true,
toplevel: true,
unsafe: true,
unused: true,
}
input: {
function f(b) {
return ("" + (b &= 0))[b && this];
}
var a = f();
console.log(a);
}
expect: {
var a = function(b) {
return ("" + (b &= 0))[b && this];
}();
console.log(a);
}
expect_stdout: "0"
}