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"
}

View File

@@ -1815,8 +1815,8 @@ issue_4288: {
console.log(typeof b);
}()]: a,
}) {
var a = a;
a++;
var b = a;
b++;
}
f(0);
}
@@ -1848,8 +1848,8 @@ issue_4294: {
}) {}({
[a]: 0,
});
var a = A;
console.log(a);
var b = A;
console.log(b);
})();
}
expect_stdout: "PASS"