fix corner case with default values (#4484)

fixes #4483
This commit is contained in:
Alex Lam S.L
2020-12-30 17:47:00 +00:00
committed by GitHub
parent 0013cbf91f
commit 8b954b022b
3 changed files with 22 additions and 1 deletions

View File

@@ -1206,3 +1206,24 @@ issue_4468: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_4483: {
options = {
conditionals: true,
evaluate: true,
reduce_vars: true,
toplevel: true,
}
input: {
if (console)
var [ a = "FAIL" ] = [], b = a = "PASS";
console.log(b);
}
expect: {
var a, b;
console && ([ a = "FAIL" ] = [], b = "PASS");
console.log(b);
}
expect_stdout: "PASS"
node_version: ">=6"
}