aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 999e03c4..f82d99ef 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1348,8 +1348,9 @@ merge(Compressor.prototype, {
if (expr instanceof AST_VarDef) {
var def = expr.name.definition();
if (!member(expr.name, def.orig)) return;
- var declared = def.orig.length - def.eliminated;
var referenced = def.references.length - def.replaced;
+ if (!referenced) return;
+ var declared = def.orig.length - def.eliminated;
if (declared > 1 && !(expr.name instanceof AST_SymbolFunarg)
|| (referenced > 1 ? mangleable_var(expr) : !compressor.exposed(def))) {
return make_node(AST_SymbolRef, expr.name, expr.name);