Skip to content

Commit

Permalink
fix corner case in inline (#5846)
Browse files Browse the repository at this point in the history
fixes #5842
  • Loading branch information
alexlamsl authored Jun 16, 2024
1 parent dc51a23 commit 8dc99fa
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/compress.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}));
Expand Down
40 changes: 40 additions & 0 deletions test/compress/yields.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit 8dc99fa

Please sign in to comment.