Fix RHS concat (raised in #330)

When attempting to concat the left-side of the rhs, make sure the rhs is
a string.
This commit is contained in:
Richard van Velzen
2013-10-26 18:44:52 +02:00
parent cfd5c6155c
commit e2daee9a65

View File

@@ -2067,7 +2067,8 @@ merge(Compressor.prototype, {
&& self.left.right instanceof AST_Constant
&& self.right instanceof AST_Binary
&& self.right.operator == "+"
&& self.right.left instanceof AST_Constant) {
&& self.right.left instanceof AST_Constant
&& self.right.is_string(compressor)) {
self = make_node(AST_Binary, self, {
operator: "+",
left: make_node(AST_Binary, self.left, {