fix corner case in inline (#5846)

fixes #5842
This commit is contained in:
Alex Lam S.L
2024-06-17 02:09:06 +03:00
committed by GitHub
parent dc51a23d31
commit 8dc99fa25f
2 changed files with 41 additions and 1 deletions

View File

@@ -14166,7 +14166,7 @@ Compressor.prototype.compress = function(node) {
stat.walk(find_return);
return !abort;
}) && node.bcatch) node.bcatch.walk(find_return);
return true;
return;
}
if (node instanceof AST_Scope) return true;
}));

View File

@@ -2207,3 +2207,43 @@ issue_5754: {
]
node_version: ">=10"
}
issue_5842: {
options = {
inline: true,
}
input: {
var a = "FAIL";
(async function*() {
(function() {
try {
try {
return console;
} finally {
a = "PASS";
}
} catch (e) {}
FAIL;
})();
})().next();
console.log(a);
}
expect: {
var a = "FAIL";
(async function*() {
(function() {
try {
try {
return console;
} finally {
a = "PASS";
}
} catch (e) {}
FAIL;
})();
})().next();
console.log(a);
}
expect_stdout: "PASS"
node_version: ">=10"
}