aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-05-19 22:11:39 +0100
committerGitHub <noreply@github.com>2021-05-20 05:11:39 +0800
commitd6152e6a76908223cace651898e12a3b3c9a445d (patch)
treee208e034823e2fb26aada3949db6a3cd321c88dd /lib
parentd930c705f6064448c7e6cba8e0e9e8d46d5e3762 (diff)
downloadtracifyjs-d6152e6a76908223cace651898e12a3b3c9a445d.tar.gz
tracifyjs-d6152e6a76908223cace651898e12a3b3c9a445d.zip
fix corner case in `collapse_vars` (#4946)
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 6f702ea9..9a6d0191 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1911,7 +1911,8 @@ merge(Compressor.prototype, {
if (!--replaced) abort = true;
if (is_lhs(node, multi_replacer.parent())) return node;
var ref = rvalue.clone();
- value_def.references.push(ref);
+ ref.scope = node.scope;
+ ref.reference();
if (replaced == assign_pos) {
abort = true;
return make_node(AST_Assign, candidate, {