if (init instanceof AST_Definitions) {
init.definitions[0].name.match_symbol(function(node) {
if (node instanceof AST_SymbolDeclaration) node.definition().fixed = false;
- });
+ }, true);
} else if (init instanceof AST_SymbolRef) {
init.definition().fixed = false;
}
AST_Node.DEFMETHOD("match_symbol", function(predicate) {
return predicate(this);
});
- AST_Destructured.DEFMETHOD("match_symbol", function(predicate) {
+ AST_Destructured.DEFMETHOD("match_symbol", function(predicate, allow_computed_keys) {
var found = false;
var tw = new TreeWalker(function(node) {
if (found) return true;
if (node instanceof AST_DestructuredKeyVal) {
+ if (!allow_computed_keys && node.key instanceof AST_Node) return found = true;
node.value.walk(tw);
return true;
}
name: node,
value: make_value(compressor, node)
}));
- });
+ }, true);
});
return dropped;
};
if (node instanceof AST_SymbolDeclaration) {
return !node.fixed_value() || may_overlap(compressor, node.definition());
}
- });
+ }, true);
}) ? to_var(self) : self;
}
def.fixed = false;
return strip_assignment();
} else if (parent instanceof AST_VarDef) {
+ if (!(parent.name instanceof AST_SymbolDeclaration)) continue;
if (parent.name.definition() !== def) continue;
if (in_try(level, parent)) break;
def.fixed = false;