aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-05-09 01:50:25 +0100
committerGitHub <noreply@github.com>2020-05-09 08:50:25 +0800
commitb06fd8a9331c377dd3d95ddb78a52ea11c58f8df (patch)
tree64da9c1d52d8089925003270be86bb2204945462 /lib
parent1bb0804d60cabbe048b05735dd2322dcc6d7bedd (diff)
downloadtracifyjs-b06fd8a9331c377dd3d95ddb78a52ea11c58f8df.tar.gz
tracifyjs-b06fd8a9331c377dd3d95ddb78a52ea11c58f8df.zip
improve fix for #3856 (#3862)
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js3
1 files changed, 1 insertions, 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;
}));
}
}