fix corner case in inline (#5289)

fixes #5288
This commit is contained in:
Alex Lam S.L
2022-01-12 08:24:50 +00:00
committed by GitHub
parent 9a58270b70
commit f8602aca96
2 changed files with 28 additions and 4 deletions

View File

@@ -3367,3 +3367,28 @@ issue_5189_2: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5288: {
options = {
conditionals: true,
inline: true,
reduce_vars: true,
toplevel: true,
unused: true,
varify: true,
}
input: {
while (function([]) {}([ function f() {
if (console)
return console.log("PASS");
else {
let a = 0;
}
}() ]));
}
expect: {
while ([ [ console ? console.log("PASS") : 0 ] ], void 0);
}
expect_stdout: "PASS"
node_version: ">=6"
}