@@ -7251,15 +7251,13 @@ Compressor.prototype.compress = function(node) {
|
|||||||
node.name = null;
|
node.name = null;
|
||||||
}
|
}
|
||||||
if (node instanceof AST_Lambda) {
|
if (node instanceof AST_Lambda) {
|
||||||
|
descend_scope();
|
||||||
if (drop_funcs && node !== self && node instanceof AST_LambdaDefinition) {
|
if (drop_funcs && node !== self && node instanceof AST_LambdaDefinition) {
|
||||||
var def = node.name.definition();
|
var def = node.name.definition();
|
||||||
if (!(def.id in in_use_ids)) {
|
if (!(def.id in in_use_ids)) {
|
||||||
log(node.name, "Dropping unused function {name}");
|
log(node.name, "Dropping unused function {name}");
|
||||||
def.eliminated++;
|
def.eliminated++;
|
||||||
if (parent instanceof AST_ExportDefault) {
|
if (parent instanceof AST_ExportDefault) return to_func_expr(node, true);
|
||||||
descend_scope();
|
|
||||||
return to_func_expr(node, true);
|
|
||||||
}
|
|
||||||
return in_list ? List.skip : make_node(AST_EmptyStatement, node);
|
return in_list ? List.skip : make_node(AST_EmptyStatement, node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7357,6 +7355,7 @@ Compressor.prototype.compress = function(node) {
|
|||||||
}
|
}
|
||||||
fns_with_marked_args.push(node);
|
fns_with_marked_args.push(node);
|
||||||
}
|
}
|
||||||
|
return node;
|
||||||
}
|
}
|
||||||
if (node instanceof AST_Catch && node.argname instanceof AST_Destructured) {
|
if (node instanceof AST_Catch && node.argname instanceof AST_Destructured) {
|
||||||
node.argname.transform(trimmer);
|
node.argname.transform(trimmer);
|
||||||
|
|||||||
@@ -1624,3 +1624,21 @@ issue_5552_4: {
|
|||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
node_version: ">=6"
|
node_version: ">=6"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5705: {
|
||||||
|
options = {
|
||||||
|
reduce_vars: true,
|
||||||
|
rests: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
(function(...a) {
|
||||||
|
var b = { ...a };
|
||||||
|
})(console.log("PASS"));
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
(function() {})(console.log("PASS"));
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=8.3.0"
|
||||||
|
}
|
||||||
|
|||||||
@@ -584,9 +584,7 @@ issue_4668: {
|
|||||||
}
|
}
|
||||||
expect: {
|
expect: {
|
||||||
console.log(function f() {
|
console.log(function f() {
|
||||||
(function g() {
|
(function g() {})();
|
||||||
0;
|
|
||||||
})();
|
|
||||||
}());
|
}());
|
||||||
}
|
}
|
||||||
expect_stdout: "undefined"
|
expect_stdout: "undefined"
|
||||||
|
|||||||
Reference in New Issue
Block a user