aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRichard van Velzen <rvanvelzen1@gmail.com>2013-10-26 18:44:52 +0200
committerRichard van Velzen <rvanvelzen1@gmail.com>2013-10-26 18:44:52 +0200
commite2daee9a655160e4eeea6dee4ceddfe0049ebacf (patch)
treefaf0e9dd007ec2c431a9a673530a42fd8294841d /lib
parentcfd5c6155c4774b4def6711c5159d9080148a7ae (diff)
downloadtracifyjs-e2daee9a655160e4eeea6dee4ceddfe0049ebacf.tar.gz
tracifyjs-e2daee9a655160e4eeea6dee4ceddfe0049ebacf.zip
Fix RHS concat (raised in #330)
When attempting to concat the left-side of the rhs, make sure the rhs is a string.
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 121e312a..13ae7c70 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -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, {