aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-11-18 15:43:55 +0000
committerGitHub <noreply@github.com>2020-11-18 23:43:55 +0800
commitf6a83f794456c65ba927c0ccf55ff88c5c003a66 (patch)
treeaab67c440c0011df3bfc21392c82bea5ab61cc1c /lib
parent35283e5dd18bb2b3be46a25786e2e73e8a24a863 (diff)
downloadtracifyjs-f6a83f794456c65ba927c0ccf55ff88c5c003a66.tar.gz
tracifyjs-f6a83f794456c65ba927c0ccf55ff88c5c003a66.zip
fix corner case in `merge_vars` (#4299)
fixes #4298
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 2a8ba8a0..49c1572d 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -4749,9 +4749,13 @@ merge(Compressor.prototype, {
var def = ref.definition();
var ldef = node.variables.get(ref.name);
if (ldef && (ldef === def || def.undeclared || node.parent_scope.find_variable(ref) === def)) {
+ references[def.id] = false;
references[ldef.id] = false;
} else {
+ var save = segment;
+ pop();
mark(ref, true, false);
+ segment = save;
}
return true;
});