diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-02-13 07:10:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-13 07:10:37 +0800 |
commit | d8e0e34354ea8c93a321210ba8a01d1a88a1dbc7 (patch) | |
tree | 0cc2ab9977bfb5226f0dc7c65e895bd918959af1 /lib/compress.js | |
parent | 0c4f315c026e607d00dd74ad7417344a937bf6dd (diff) | |
download | tracifyjs-d8e0e34354ea8c93a321210ba8a01d1a88a1dbc7.tar.gz tracifyjs-d8e0e34354ea8c93a321210ba8a01d1a88a1dbc7.zip |
collapse within unary expressions (#2910)
Diffstat (limited to 'lib/compress.js')
-rw-r--r-- | lib/compress.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js index ad691f7a..a161b457 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -1260,6 +1260,8 @@ merge(Compressor.prototype, { } else if (expr instanceof AST_Unary) { if (expr.operator == "++" || expr.operator == "--") { candidates.push(hit_stack.slice()); + } else { + extract_candidates(expr.expression); } } else if (expr instanceof AST_VarDef) { if (expr.value) { @@ -1314,6 +1316,7 @@ merge(Compressor.prototype, { return find_stop(parent, level + 1, true); } if (parent instanceof AST_Switch) return node; + if (parent instanceof AST_Unary) return node; if (parent instanceof AST_VarDef) return node; return null; } |