diff --git a/lib/compress.js b/lib/compress.js index 5cf2a2e6613..4e9cf95d2c1 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -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; })); diff --git a/test/compress/yields.js b/test/compress/yields.js index 0736adaa0d2..933fc295179 100644 --- a/test/compress/yields.js +++ b/test/compress/yields.js @@ -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" +}