aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/compress.js b/lib/compress.js
index cf46e47f..f66b7185 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -7767,12 +7767,11 @@ merge(Compressor.prototype, {
associative = compressor.option("unsafe_math");
// +a - b => a - b
// a - +b => a - b
- [ "left", "right" ].forEach(function(operand) {
+ if (self.operator != "+") [ "left", "right" ].forEach(function(operand) {
var node = self[operand];
if (node instanceof AST_UnaryPrefix && node.operator == "+") {
var exp = node.expression;
- if (exp.is_boolean(compressor) || exp.is_number(compressor)
- || self.operator != "+" && exp.is_string(compressor)) {
+ if (exp.is_boolean(compressor) || exp.is_number(compressor) || exp.is_string(compressor)) {
self[operand] = exp;
}
}