fix corner case in dead_code (#5031)

fixes #5030
This commit is contained in:
Alex Lam S.L
2021-06-23 15:56:28 +01:00
committed by GitHub
parent 980dbde171
commit 7cbcd11440
3 changed files with 84 additions and 18 deletions

View File

@@ -422,7 +422,9 @@ inline_loop_1: {
inline_loop_2: {
options = {
inline: true,
sequences: true,
toplevel: true,
unused: true,
}
input: {
while (function(a = [ "PASS" ]) {
@@ -432,10 +434,11 @@ inline_loop_2: {
}());
}
expect: {
while (a = [ "PASS" ], a = function f(b) {
console.log(a[b]);
}(0), void 0) ;
var a;
while (a = [ "PASS" ],
b = void 0,
b = 0,
void (a = void console.log(a[b])));
var a, b;
}
expect_stdout: "PASS"
node_version: ">=6"