aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-28 17:08:16 +0800
committerGitHub <noreply@github.com>2017-03-28 17:08:16 +0800
commitf71f4905b004a559f0612e0e0928204f912a66bc (patch)
tree9a97f9bb73ed3aee31bc709db386dc8a97de227e /lib
parentfb177a6312ccd90918c9f8f0f867c2fddd85a2c8 (diff)
downloadtracifyjs-f71f4905b004a559f0612e0e0928204f912a66bc.tar.gz
tracifyjs-f71f4905b004a559f0612e0e0928204f912a66bc.zip
fix `is_number()` on `+=` (#1714)
fixes #1710
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index e4863d9f..c60f8632 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1167,9 +1167,9 @@ merge(Compressor.prototype, {
&& this.left.is_number(compressor)
&& this.right.is_number(compressor);
});
- var assign = makePredicate("-= *= /= %= &= |= ^= <<= >>= >>>=");
def(AST_Assign, function(compressor){
- return assign(this.operator) || this.right.is_number(compressor);
+ return binary(this.operator.slice(0, -1))
+ || this.operator == "=" && this.right.is_number(compressor);
});
def(AST_Seq, function(compressor){
return this.cdr.is_number(compressor);