enhance assignments (#3612)

This commit is contained in:
Alex Lam S.L
2019-11-28 07:40:34 +08:00
committed by GitHub
parent 168ae747ad
commit 5a88c30d65
2 changed files with 40 additions and 6 deletions

View File

@@ -6720,8 +6720,8 @@ merge(Compressor.prototype, {
self.right = self.right.left;
}
}
if ((self.operator == "+=" || self.operator == "-=")
&& self.left.is_number(compressor)
if ((self.operator == "-=" || self.operator == "+="
&& (self.left.is_boolean(compressor) || self.left.is_number(compressor)))
&& self.right instanceof AST_Number
&& self.right.getValue() === 1) {
var op = self.operator.slice(0, -1);