diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compress.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js index 9504241b..b7a91ea5 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -4200,8 +4200,15 @@ merge(Compressor.prototype, { } else if (sym.orig[0] instanceof AST_SymbolCatch) { var value = def.value && def.value.drop_side_effect_free(compressor); if (value) side_effects.push(value); - def.value = null; - head.push(def); + var var_defs = var_defs_by_id.get(sym.id); + if (var_defs.length > 1) { + AST_Node.warn("Dropping duplicated declaration of variable {name} [{file}:{line},{col}]", template(def.name)); + remove(var_defs, def); + sym.eliminated++; + } else { + def.value = null; + head.push(def); + } } else { var value = def.value && !def.value.single_use && def.value.drop_side_effect_free(compressor); if (value) { |