From d1c8947f7463d3a86c254af8bea6d1674f846376 Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Sat, 9 May 2020 06:29:48 +0800 Subject: [PATCH] improve fix for #3856 --- lib/compress.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/compress.js b/lib/compress.js index 09eaacbf..fb4836bf 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -2575,12 +2575,11 @@ merge(Compressor.prototype, { if (!declarations_only(node)) return node; defs.definitions = defs.definitions.concat(node.definitions); CHANGED = true; + if (parent instanceof AST_For && parent.init === node) return null; return in_list ? List.skip : make_node(AST_EmptyStatement, node); } if (node instanceof AST_Scope) return node; if (!(node instanceof AST_Statement)) return node; - }, function(node) { - if (node instanceof AST_For && is_empty(node.init)) node.init = null; })); } }