aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-09-19 18:45:52 +0100
committerGitHub <noreply@github.com>2020-09-20 01:45:52 +0800
commit3c609e2f4a925b3c47bfa2b9185a353295f353b3 (patch)
treed696a42ca1da86111822ca0d79a797326fbc8090 /lib/compress.js
parentf0ae03ed3933fb967921924dc524f4cca8587ce4 (diff)
downloadtracifyjs-3c609e2f4a925b3c47bfa2b9185a353295f353b3.tar.gz
tracifyjs-3c609e2f4a925b3c47bfa2b9185a353295f353b3.zip
enhance `unused` (#4129)
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 0f9fa6b2..3059c932 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -4747,6 +4747,13 @@ merge(Compressor.prototype, {
}));
}
}
+ } else if (node instanceof AST_UnaryPostfix
+ && node.expression instanceof AST_SymbolRef
+ && indexOf_assign(node.expression.definition(), node) < 0) {
+ return make_node(AST_UnaryPrefix, node, {
+ operator: "+",
+ expression: node.expression
+ });
}
}
if (node instanceof AST_Call) calls_to_drop_args.push(node);