@@ -12313,8 +12313,10 @@ merge(Compressor.prototype, {
|
|||||||
|
|
||||||
OPT(AST_DestructuredArray, function(self, compressor) {
|
OPT(AST_DestructuredArray, function(self, compressor) {
|
||||||
if (compressor.option("rests") && self.rest instanceof AST_DestructuredArray) {
|
if (compressor.option("rests") && self.rest instanceof AST_DestructuredArray) {
|
||||||
self.elements = self.elements.concat(self.rest.elements);
|
return make_node(AST_DestructuredArray, self, {
|
||||||
self.rest = self.rest.rest;
|
elements: self.elements.concat(self.rest.elements),
|
||||||
|
rest: self.rest.rest,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1069,3 +1069,25 @@ issue_5100_2: {
|
|||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
node_version: ">=10"
|
node_version: ">=10"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5108: {
|
||||||
|
options = {
|
||||||
|
evaluate: true,
|
||||||
|
reduce_vars: true,
|
||||||
|
rests: true,
|
||||||
|
unsafe: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
console.log(function([ ...[ a ] ]) {
|
||||||
|
return a;
|
||||||
|
}([ "PASS", "FAIL" ]));
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
console.log(function([]) {
|
||||||
|
return "PASS";
|
||||||
|
}([ "PASS", "FAIL" ]));
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=6"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user