@@ -3126,7 +3126,7 @@ merge(Compressor.prototype, {
|
|||||||
if (prev) {
|
if (prev) {
|
||||||
if (stat instanceof AST_Exit) {
|
if (stat instanceof AST_Exit) {
|
||||||
if (stat.value || !in_async_generator(scope)) {
|
if (stat.value || !in_async_generator(scope)) {
|
||||||
stat.value = cons_seq(stat.value || make_node(AST_Undefined, stat)).transform(compressor);
|
stat.value = cons_seq(stat.value || make_node(AST_Undefined, stat)).optimize(compressor);
|
||||||
}
|
}
|
||||||
} else if (stat instanceof AST_For) {
|
} else if (stat instanceof AST_For) {
|
||||||
if (!(stat.init instanceof AST_Definitions)) {
|
if (!(stat.init instanceof AST_Definitions)) {
|
||||||
|
|||||||
@@ -1246,3 +1246,37 @@ issue_4618: {
|
|||||||
expect_stdout: "function"
|
expect_stdout: "function"
|
||||||
node_version: ">=8"
|
node_version: ">=8"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4717: {
|
||||||
|
options = {
|
||||||
|
inline: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
sequences: true,
|
||||||
|
side_effects: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(function() {
|
||||||
|
async function f() {
|
||||||
|
var a = function() {
|
||||||
|
await;
|
||||||
|
}();
|
||||||
|
return "FAIL";
|
||||||
|
}
|
||||||
|
return f();
|
||||||
|
})().then(console.log).catch(function() {
|
||||||
|
console.log("PASS");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
(async function() {
|
||||||
|
return function() {
|
||||||
|
await;
|
||||||
|
}(), "FAIL";
|
||||||
|
})().then(console.log).catch(function() {
|
||||||
|
console.log("PASS");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=8"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user