This commit is contained in:
Fábio Santos 2018-03-29 17:18:04 +00:00 committed by GitHub
commit 15f2a1608b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View File

@ -1047,6 +1047,9 @@ merge(Compressor.prototype, {
|| node instanceof AST_Call && lhs instanceof AST_PropAccess && lhs.equivalent_to(node.expression)
|| node instanceof AST_Debugger
|| node instanceof AST_Destructuring
|| node instanceof AST_Expansion
&& node.expression instanceof AST_Symbol
&& node.expression.definition().references.length > 1
|| node instanceof AST_IterationStatement && !(node instanceof AST_For)
|| node instanceof AST_LoopControl
|| node instanceof AST_Try

View File

@ -1601,3 +1601,28 @@ issue_2874_3: {
]
node_version: ">=6"
}
issue_3028: {
options = {
collapse_vars: true,
evaluate: true,
side_effects: true,
unused: true,
}
input: {
function a(array) {
var shifted = array.splice(0, 2);
return [ ...array, ...shifted ];
}
console.log(a([ 1, 2, 3 ]).join(" "));
}
expect: {
function a(array) {
var shifted = array.splice(0, 2);
return [ ...array, ...shifted ];
}
console.log(a([ 1, 2, 3 ]).join(" "));
}
expect_stdout: "3 1 2"
node_version: ">=6"
}