@@ -6513,8 +6513,10 @@ merge(Compressor.prototype, {
|
||||
return null;
|
||||
}, true);
|
||||
if (trimmed.name) {
|
||||
def.name = trimmed.name;
|
||||
def.value = value = trimmed.value;
|
||||
def = make_node(AST_VarDef, def, {
|
||||
name: trimmed.name,
|
||||
value: value = trimmed.value,
|
||||
});
|
||||
flush();
|
||||
} else if (trimmed.value) {
|
||||
side_effects.push(trimmed.value);
|
||||
@@ -6722,19 +6724,18 @@ merge(Compressor.prototype, {
|
||||
}
|
||||
if (node instanceof AST_Assign) {
|
||||
descend(node, tt);
|
||||
if (node.left instanceof AST_Destructured) {
|
||||
var trimmed = trim_destructured(node.left, node.right, function(node) {
|
||||
return node;
|
||||
}, node.write_only === true);
|
||||
if (!trimmed.name) {
|
||||
if (trimmed.value) return trimmed.value;
|
||||
if (parent instanceof AST_Sequence && parent.tail_node() !== node) return List.skip;
|
||||
return make_node(AST_Number, node, { value: 0 });
|
||||
}
|
||||
node.left = trimmed.name;
|
||||
node.right = trimmed.value;
|
||||
}
|
||||
return node;
|
||||
if (!(node.left instanceof AST_Destructured)) return node;
|
||||
var trimmed = trim_destructured(node.left, node.right, function(node) {
|
||||
return node;
|
||||
}, node.write_only === true);
|
||||
if (trimmed.name) return make_node(AST_Assign, node, {
|
||||
operator: node.operator,
|
||||
left: trimmed.name,
|
||||
right: trimmed.value,
|
||||
});
|
||||
if (trimmed.value) return trimmed.value;
|
||||
if (parent instanceof AST_Sequence && parent.tail_node() !== node) return List.skip;
|
||||
return make_node(AST_Number, node, { value: 0 });
|
||||
}
|
||||
if (node instanceof AST_LabeledStatement && node.body instanceof AST_For) {
|
||||
// Certain combination of unused name + side effect leads to invalid AST:
|
||||
|
||||
Reference in New Issue
Block a user