fix corner case in reduce_vars (#5464)

fixes #5463
This commit is contained in:
Alex Lam S.L
2022-05-23 04:08:12 +01:00
committed by GitHub
parent c2ca7b7659
commit d4caa97b88
2 changed files with 33 additions and 6 deletions

View File

@@ -2395,3 +2395,29 @@ issue_5448_4: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5463: {
options = {
collapse_vars: true,
conditionals: true,
evaluate: true,
reduce_vars: true,
toplevel: true,
unsafe: true,
}
input: {
if (console.log("PASS"))
var a = void 0,
b = void 0,
b = ([ a = FAIL ] = b && b);
}
expect: {
var a, b, b;
console.log("PASS") && (
b = a = void 0,
b = [a = FAIL] = a && a
);
}
expect_stdout: "PASS"
node_version: ">=6"
}