aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index bab390cf..2c21217e 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -4682,8 +4682,8 @@ merge(Compressor.prototype, {
}
var def = sym.definition();
if (!def) return;
- if (def.scope !== self) return;
if (def.id in in_use_ids) return;
+ if (def.scope !== self && member(def, self.enclosed)) return;
log(sym, "Dropping unused loop variable {name}");
var value = node.object.drop_side_effect_free(compressor);
if (!value) return in_list ? List.skip : make_node(AST_EmptyStatement, node);