aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-15 04:33:17 +0000
committerGitHub <noreply@github.com>2021-01-15 12:33:17 +0800
commit18dbceb36f02db6100c1588a77c18c6ca73f1baa (patch)
treed858ac813b5dc956156584954ac3496d52e5fb6b /lib/compress.js
parent65d39a3702643a8dc6a3b797a15470e6715d6f84 (diff)
downloadtracifyjs-18dbceb36f02db6100c1588a77c18c6ca73f1baa.tar.gz
tracifyjs-18dbceb36f02db6100c1588a77c18c6ca73f1baa.zip
fix corner case in `unused` (#4557)
fixes #4556
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js
index fadd7415..01ec7e60 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -5766,6 +5766,9 @@ merge(Compressor.prototype, {
var write_only = def.value.write_only;
var value = def.value.drop_side_effect_free(compressor);
if (def.value !== value) {
+ sym.references.forEach(function(node) {
+ if (node.fixed === sym.fixed) node.fixed = def.value;
+ });
def.value = null;
if (value) {
AST_Node.warn("Side effects in last use of variable {name} [{file}:{line},{col}]", template(def.name));