@@ -6184,7 +6184,7 @@ Compressor.prototype.compress = function(node) {
|
||||
}
|
||||
if (node instanceof AST_Scope) {
|
||||
var in_iife = false;
|
||||
if (node instanceof AST_LambdaExpression && !node.name) {
|
||||
if (node instanceof AST_LambdaExpression && !node.name && !is_async(node) && !is_generator(node)) {
|
||||
var parent = tw.parent();
|
||||
in_iife = parent && parent.TYPE == "Call" && parent.expression === node;
|
||||
}
|
||||
|
||||
@@ -1748,8 +1748,8 @@ issue_4454_2: {
|
||||
expect: {
|
||||
function f(a) {
|
||||
(async function(c = console.log(a)) {})();
|
||||
var a = 42..toString();
|
||||
console.log(a);
|
||||
var b = 42..toString();
|
||||
console.log(b);
|
||||
}
|
||||
f("PASS");
|
||||
}
|
||||
@@ -2959,3 +2959,45 @@ issue_5305_3: {
|
||||
expect_stdout: "PASS"
|
||||
node_version: ">=8"
|
||||
}
|
||||
|
||||
issue_5456: {
|
||||
options = {
|
||||
inline: true,
|
||||
merge_vars: true,
|
||||
}
|
||||
input: {
|
||||
var a = true;
|
||||
(function() {
|
||||
(function(b, c) {
|
||||
var d = async function() {
|
||||
c = await null;
|
||||
}();
|
||||
var e = function() {
|
||||
if (c)
|
||||
console.log(typeof d);
|
||||
while (b);
|
||||
}();
|
||||
})(function(i) {
|
||||
return console.log("foo") && i;
|
||||
}(a));
|
||||
})();
|
||||
}
|
||||
expect: {
|
||||
var a = true;
|
||||
(function() {
|
||||
b = (i = a, console.log("foo") && i),
|
||||
i = async function() {
|
||||
c = await null;
|
||||
}(),
|
||||
e = function() {
|
||||
if (c) console.log(typeof i);
|
||||
while (b);
|
||||
}(),
|
||||
void 0;
|
||||
var b, c, i, e;
|
||||
var i;
|
||||
})();
|
||||
}
|
||||
expect_stdout: "foo"
|
||||
node_version: ">=8"
|
||||
}
|
||||
|
||||
@@ -978,8 +978,8 @@ issue_4454_2: {
|
||||
expect: {
|
||||
function f(a) {
|
||||
(function*(c = console.log(a)) {})();
|
||||
var a = 42..toString();
|
||||
console.log(a);
|
||||
var b = 42..toString();
|
||||
console.log(b);
|
||||
}
|
||||
f("PASS");
|
||||
}
|
||||
@@ -1547,3 +1547,45 @@ issue_5425: {
|
||||
expect_stdout: "PASS undefined"
|
||||
node_version: ">=4"
|
||||
}
|
||||
|
||||
issue_5456: {
|
||||
options = {
|
||||
inline: true,
|
||||
merge_vars: true,
|
||||
}
|
||||
input: {
|
||||
var a = true;
|
||||
(function() {
|
||||
(function(b, c) {
|
||||
var d = function*() {
|
||||
c = null;
|
||||
}();
|
||||
var e = function() {
|
||||
if (c)
|
||||
console.log(typeof d);
|
||||
while (b);
|
||||
}();
|
||||
})(function(i) {
|
||||
return console.log("foo") && i;
|
||||
}(a));
|
||||
})();
|
||||
}
|
||||
expect: {
|
||||
var a = true;
|
||||
(function() {
|
||||
b = (i = a, console.log("foo") && i),
|
||||
i = function*() {
|
||||
c = null;
|
||||
}(),
|
||||
e = function() {
|
||||
if (c) console.log(typeof i);
|
||||
while (b);
|
||||
}(),
|
||||
void 0;
|
||||
var b, c, i, e;
|
||||
var i;
|
||||
})();
|
||||
}
|
||||
expect_stdout: "foo"
|
||||
node_version: ">=4"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user