fix corner case in merge_vars (#5466)

fixes #5465
This commit is contained in:
Alex Lam S.L
2022-05-23 22:45:07 +01:00
committed by GitHub
parent d4caa97b88
commit 740f93f5a9
3 changed files with 64 additions and 33 deletions

View File

@@ -2421,3 +2421,30 @@ issue_5463: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5465: {
options = {
inline: true,
merge_vars: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
function f(a, b) {
(function(c = b = "FAIL 2") {
this && console.log(b || "PASS");
})(42 - a && a);
}
f("FAIL 1");
}
expect: {
a = "FAIL 1",
void function(c = b = "FAIL 2") {
this && console.log(b || "PASS");
}(42 - a && a);
var a, b;
}
expect_stdout: "PASS"
node_version: ">=6"
}