aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-10-24 15:44:20 +0100
committerGitHub <noreply@github.com>2020-10-24 22:44:20 +0800
commite478da24c7b185322c8898444470036fdec31c0d (patch)
tree8e5363b1a4374c1a25416d3ad9c77c13e8f78c50 /lib
parentc5df8355ba00fdf5ffa81192e0d88cf0dca90061 (diff)
downloadtracifyjs-e478da24c7b185322c8898444470036fdec31c0d.tar.gz
tracifyjs-e478da24c7b185322c8898444470036fdec31c0d.zip
fix corner case in `collapse_vars` (#4243)
fixes #4242
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 216ca92a..647c97e1 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1974,6 +1974,7 @@ merge(Compressor.prototype, {
}
function foldable(expr) {
+ if (expr instanceof AST_Assign && expr.right.single_use) return;
var lhs_ids = Object.create(null);
var marker = new TreeWalker(function(node) {
if (node instanceof AST_SymbolRef) lhs_ids[node.definition().id] = true;