Adding arrow functions

This commit is contained in:
Fábio Santos
2015-01-11 20:07:19 +00:00
parent 9d7d365c2b
commit fa5c4f2d03
6 changed files with 129 additions and 2 deletions

View File

@@ -1019,6 +1019,7 @@ merge(Compressor.prototype, {
});
OPT(AST_Block, function(self, compressor){
if (self.body instanceof AST_Node) { return self; }
self.body = tighten_body(self.body, compressor);
return self;
});
@@ -1225,6 +1226,7 @@ merge(Compressor.prototype, {
var hoist_funs = compressor.option("hoist_funs");
var hoist_vars = compressor.option("hoist_vars");
var self = this;
if (!(self.body instanceof Array)) { return self; } // Hoisting makes no sense in an arrow func
if (hoist_funs || hoist_vars) {
var dirs = [];
var hoisted = [];