aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index e8b271f3..536b7518 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -2751,9 +2751,16 @@ merge(Compressor.prototype, {
}
// x && (y && z) ==> x && y && z
// x || (y || z) ==> x || y || z
+ // x + ("y" + z) ==> x + "y" + z
+ // "x" + (y + "z")==> "x" + y + "z"
if (self.right instanceof AST_Binary
&& self.right.operator == self.operator
- && (self.operator == "&&" || self.operator == "||"))
+ && (self.operator == "&&"
+ || self.operator == "||"
+ || (self.operator == "+"
+ && (self.right.left.is_string(compressor)
+ || (self.left.is_string(compressor)
+ && self.right.right.is_string(compressor))))))
{
self.left = make_node(AST_Binary, self.left, {
operator : self.operator,