fix corner case in evaluate (#4501)

fixes #4500
This commit is contained in:
Alex Lam S.L
2021-01-03 18:31:20 +00:00
committed by GitHub
parent 623a0d920f
commit df2cfcb5fc
2 changed files with 34 additions and 2 deletions

View File

@@ -2302,3 +2302,27 @@ issue_4485_3: {
expect_stdout: true
node_version: ">=6"
}
issue_4500: {
options = {
evaluate: true,
keep_fnames: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
var a = function f(b) {
return [ b ] = [], b;
}("FAIL");
console.log(a || "PASS");
}
expect: {
var a = function f(b) {
return [ b ] = [], b;
}("FAIL");
console.log(a || "PASS");
}
expect_stdout: "PASS"
node_version: ">=6"
}