@@ -7820,6 +7820,7 @@ merge(Compressor.prototype, {
|
|||||||
if (abort) return true;
|
if (abort) return true;
|
||||||
if (tw.parent() === exp && node.may_throw(compressor)) return abort = true;
|
if (tw.parent() === exp && node.may_throw(compressor)) return abort = true;
|
||||||
if (node instanceof AST_Await) return abort = true;
|
if (node instanceof AST_Await) return abort = true;
|
||||||
|
if (node instanceof AST_ForAwaitOf) return abort = true;
|
||||||
if (node instanceof AST_Return) {
|
if (node instanceof AST_Return) {
|
||||||
if (node.value && !is_primitive(compressor, node.value)) return abort = true;
|
if (node.value && !is_primitive(compressor, node.value)) return abort = true;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -2023,3 +2023,26 @@ issue_5034: {
|
|||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
node_version: ">=8"
|
node_version: ">=8"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5070: {
|
||||||
|
options = {
|
||||||
|
awaits: true,
|
||||||
|
side_effects: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(async function() {
|
||||||
|
try {
|
||||||
|
for await (var a of console.log("PASS"));
|
||||||
|
} catch (e) {}
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
(async function() {
|
||||||
|
try {
|
||||||
|
for await (var a of console.log("PASS"));
|
||||||
|
} catch (e) {}
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=10"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user