@@ -13260,6 +13260,7 @@ Compressor.prototype.compress = function(node) {
|
|||||||
if (fn.body[0] instanceof AST_Directive) return;
|
if (fn.body[0] instanceof AST_Directive) return;
|
||||||
if (fn.contains_this()) return;
|
if (fn.contains_this()) return;
|
||||||
if (!scope) scope = find_scope(compressor);
|
if (!scope) scope = find_scope(compressor);
|
||||||
|
if (in_async_generator(scope)) return;
|
||||||
var defined = new Dictionary();
|
var defined = new Dictionary();
|
||||||
defined.set("NaN", true);
|
defined.set("NaN", true);
|
||||||
while (!(scope instanceof AST_Scope)) {
|
while (!(scope instanceof AST_Scope)) {
|
||||||
|
|||||||
@@ -1451,3 +1451,77 @@ issue_5177: {
|
|||||||
expect_stdout: "function"
|
expect_stdout: "function"
|
||||||
node_version: ">=4"
|
node_version: ">=4"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5385_1: {
|
||||||
|
options = {
|
||||||
|
inline: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(async function*() {
|
||||||
|
(function() {
|
||||||
|
try {
|
||||||
|
return console.log("foo");
|
||||||
|
} finally {
|
||||||
|
return console.log("bar");
|
||||||
|
}
|
||||||
|
console.log("baz");
|
||||||
|
})();
|
||||||
|
})().next();
|
||||||
|
console.log("moo");
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
(async function*() {
|
||||||
|
(function() {
|
||||||
|
try {
|
||||||
|
return console.log("foo");
|
||||||
|
} finally {
|
||||||
|
return console.log("bar");
|
||||||
|
}
|
||||||
|
console.log("baz");
|
||||||
|
})();
|
||||||
|
})().next();
|
||||||
|
console.log("moo");
|
||||||
|
}
|
||||||
|
expect_stdout: [
|
||||||
|
"foo",
|
||||||
|
"bar",
|
||||||
|
"moo",
|
||||||
|
]
|
||||||
|
node_version: ">=10"
|
||||||
|
}
|
||||||
|
|
||||||
|
issue_5385_2: {
|
||||||
|
options = {
|
||||||
|
inline: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(async function*() {
|
||||||
|
return function() {
|
||||||
|
try {
|
||||||
|
return console.log("foo");
|
||||||
|
} finally {
|
||||||
|
return console.log("bar");
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
})().next();
|
||||||
|
console.log("moo");
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
(async function*() {
|
||||||
|
return function() {
|
||||||
|
try {
|
||||||
|
return console.log("foo");
|
||||||
|
} finally {
|
||||||
|
return console.log("bar");
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
})().next();
|
||||||
|
console.log("moo");
|
||||||
|
}
|
||||||
|
expect_stdout: [
|
||||||
|
"foo",
|
||||||
|
"bar",
|
||||||
|
"moo",
|
||||||
|
]
|
||||||
|
node_version: ">=10"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user