From f886b3fb2bad77ca7158057b48add16050ceca2a Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Fri, 28 Aug 2020 19:42:17 +0100 Subject: fix corner case in `loops` & `unused` (#4083) fixes #4082 --- lib/compress.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/compress.js b/lib/compress.js index 90dd0f27..bab390cf 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -4800,7 +4800,7 @@ merge(Compressor.prototype, { return true; } if (node instanceof AST_ForIn) { - if (!compressor.option("loops")) return; + if (!drop_vars || !compressor.option("loops")) return; if (!is_empty(node.body)) return; if (node.init.has_side_effects(compressor)) return; node.object.walk(tw); -- cgit v1.2.3