aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorMihai Bazon <mihai.bazon@gmail.com>2012-11-12 00:47:56 -0800
committerMihai Bazon <mihai.bazon@gmail.com>2012-11-12 00:47:56 -0800
commitf05c99d89f0ccd18c757adfd6fa7cc93092823b5 (patch)
treea3e8e0ae60cc249ed8f70ec04c8d1ec8b4a0b4b6 /lib/compress.js
parent78856a3dabffb5e22431ee5c14656d3a64076540 (diff)
parentb49230ab8d717d91710d8c383c79ded77c78a39e (diff)
downloadtracifyjs-f05c99d89f0ccd18c757adfd6fa7cc93092823b5.tar.gz
tracifyjs-f05c99d89f0ccd18c757adfd6fa7cc93092823b5.zip
Merge pull request #41 from Skalman/toString-patch
Convert x.toString() to ""+x instead of x+""
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 469ee6e2..9400b864 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1413,9 +1413,9 @@ merge(Compressor.prototype, {
}
else if (exp instanceof AST_Dot && exp.property == "toString" && self.args.length == 0) {
return make_node(AST_Binary, self, {
- left: exp.expression,
+ left: make_node(AST_String, self, { value: "" }),
operator: "+",
- right: make_node(AST_String, self, { value: "" })
+ right: exp.expression
}).transform(compressor);
}
}