aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 8bd58bb1..35646cf1 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -746,6 +746,19 @@ merge(Compressor.prototype, {
if (d && d.constant && d.init) return ev(d.init, compressor);
throw def;
});
+ def(AST_Call, function(compressor){
+ if (compressor.option("unsafe")) {
+ if (this.expression instanceof AST_Dot
+ && this.expression.expression instanceof AST_Array
+ && this.expression.property == "join") {
+ var x = this.expression.expression.elements.map(function(el){
+ return ev(el, compressor);
+ });
+ return x.join(ev(this.args[0]));
+ }
+ }
+ throw def;
+ });
})(function(node, func){
node.DEFMETHOD("_eval", func);
});
@@ -1704,7 +1717,7 @@ merge(Compressor.prototype, {
return make_node(AST_Undefined, self).transform(compressor);
}
}
- return self;
+ return self.evaluate(compressor)[0];
});
OPT(AST_New, function(self, compressor){