fix corner case in evaluate (#3998)

fixes #3997
This commit is contained in:
Alex Lam S.L
2020-06-15 01:28:44 +08:00
committed by GitHub
parent 9aed0e3a73
commit ae9f56be10
2 changed files with 29 additions and 8 deletions

View File

@@ -2812,3 +2812,24 @@ operator_in: {
"true",
]
}
issue_3997: {
options = {
evaluate: true,
reduce_vars: true,
toplevel: true,
}
input: {
var a = function f(b) {
return b[b += this] = b;
}(0);
console.log(typeof a);
}
expect: {
var a = function f(b) {
return b[b += this] = b;
}(0);
console.log(typeof a);
}
expect_stdout: "string"
}