From 3c609e2f4a925b3c47bfa2b9185a353295f353b3 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sat, 19 Sep 2020 18:45:52 +0100 Subject: enhance `unused` (#4129) --- lib/compress.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/compress.js') 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); -- cgit v1.2.3