fix collapse_vars on destructuring declarations (#1889)

fixes #1886
This commit is contained in:
Alex Lam S.L
2017-05-09 17:44:28 +08:00
committed by GitHub
parent e0ae8da089
commit 2944e3df7d
2 changed files with 16 additions and 1 deletions

View File

@@ -799,7 +799,7 @@ merge(Compressor.prototype, {
}
function get_lhs(expr) {
if (expr instanceof AST_VarDef) {
if (expr instanceof AST_VarDef && expr.name instanceof AST_SymbolDeclaration) {
var def = expr.name.definition();
if (def.orig.length > 1
|| def.references.length == 1 && (!def.global || compressor.toplevel(def))) {