@@ -5568,13 +5568,11 @@ merge(Compressor.prototype, {
|
||||
if (def.value) def.value = def.value.transform(tt);
|
||||
if (def.name instanceof AST_Destructured) {
|
||||
var name = trim_destructured(def.name, def.value, function(node) {
|
||||
if (node instanceof AST_SymbolDeclaration) {
|
||||
if (!drop_vars) return node;
|
||||
if (node.definition().id in in_use_ids) return node;
|
||||
if (is_catch(node)) return node;
|
||||
if (is_var && !can_drop_symbol(node)) return node;
|
||||
return null;
|
||||
}
|
||||
if (!drop_vars) return node;
|
||||
if (node.definition().id in in_use_ids) return node;
|
||||
if (is_catch(node)) return node;
|
||||
if (is_var && !can_drop_symbol(node)) return node;
|
||||
return null;
|
||||
});
|
||||
if (name) {
|
||||
flush();
|
||||
@@ -5747,7 +5745,7 @@ merge(Compressor.prototype, {
|
||||
descend(node, tt);
|
||||
if (node.left instanceof AST_Destructured) {
|
||||
var lhs = trim_destructured(node.left, node.right, function(node) {
|
||||
if (node instanceof AST_SymbolRef) return node;
|
||||
return node;
|
||||
});
|
||||
if (!lhs) return node.right;
|
||||
node.left = lhs;
|
||||
|
||||
@@ -2164,3 +2164,36 @@ issue_4446: {
|
||||
expect_stdout: "PASS"
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
issue_4456: {
|
||||
options = {
|
||||
pure_getters: true,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
var o = {
|
||||
set p(v) {
|
||||
console.log(v);
|
||||
},
|
||||
};
|
||||
[ function() {
|
||||
try {
|
||||
return o;
|
||||
} catch ({}) {}
|
||||
}().p ] = [ "PASS" ];
|
||||
}
|
||||
expect: {
|
||||
var o = {
|
||||
set p(v) {
|
||||
console.log(v);
|
||||
},
|
||||
};
|
||||
[ function() {
|
||||
try {
|
||||
return o;
|
||||
} catch ({}) {}
|
||||
}().p ] = [ "PASS" ];
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user