@@ -9980,6 +9980,7 @@ merge(Compressor.prototype, {
|
|||||||
operator: "=",
|
operator: "=",
|
||||||
left: make_node(AST_DestructuredArray, self, {
|
left: make_node(AST_DestructuredArray, self, {
|
||||||
elements: fn.argnames.map(function(argname) {
|
elements: fn.argnames.map(function(argname) {
|
||||||
|
if (argname.__unused) return make_node(AST_Hole, argname);
|
||||||
return argname.convert_symbol(AST_SymbolRef, process);
|
return argname.convert_symbol(AST_SymbolRef, process);
|
||||||
}),
|
}),
|
||||||
rest: fn.rest && fn.rest.convert_symbol(AST_SymbolRef, process),
|
rest: fn.rest && fn.rest.convert_symbol(AST_SymbolRef, process),
|
||||||
|
|||||||
@@ -3057,3 +3057,71 @@ issue_5087_2: {
|
|||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
node_version: ">=6"
|
node_version: ">=6"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5114_1: {
|
||||||
|
options = {
|
||||||
|
inline: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = "PASS";
|
||||||
|
(function({}, a) {})(42);
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = "PASS";
|
||||||
|
[ {} ] = [ 42 ],
|
||||||
|
void 0;
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=6"
|
||||||
|
}
|
||||||
|
|
||||||
|
issue_5114_2: {
|
||||||
|
options = {
|
||||||
|
inline: true,
|
||||||
|
pure_getters: "strict",
|
||||||
|
reduce_vars: true,
|
||||||
|
side_effects: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = "PASS";
|
||||||
|
(function f([], a) {
|
||||||
|
f.length;
|
||||||
|
})([]);
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = "PASS";
|
||||||
|
0;
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=6"
|
||||||
|
}
|
||||||
|
|
||||||
|
issue_5114_3: {
|
||||||
|
options = {
|
||||||
|
inline: true,
|
||||||
|
pure_getters: "strict",
|
||||||
|
reduce_vars: true,
|
||||||
|
side_effects: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = "PASS";
|
||||||
|
(function f(a, {}) {
|
||||||
|
f.length;
|
||||||
|
})(null, 42);
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = "PASS";
|
||||||
|
0;
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
node_version: ">=6"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user