fix corner case in assignments (#5671)

fixes #5670
This commit is contained in:
Alex Lam S.L
2022-09-21 00:56:16 +01:00
committed by GitHub
parent 3a6e58109e
commit 9efa02afb6
2 changed files with 35 additions and 8 deletions

View File

@@ -803,3 +803,23 @@ issue_4924_2: {
expect_stdout: "PASS"
node_version: ">=15"
}
issue_5670: {
options = {
assignments: true,
evaluate: true,
reduce_vars: true,
}
input: {
(function(a, b) {
a && a && (a = b += "") || console.log("PASS");
})();
}
expect: {
(function(a, b) {
a = a,
console.log("PASS");
})();
}
expect_stdout: "PASS"
}