small improvement on merging assignments into hoisted vars

This commit is contained in:
Mihai Bazon
2012-12-05 13:14:49 +02:00
parent 320c110b33
commit 16430acc1f

View File

@@ -1152,6 +1152,15 @@ merge(Compressor.prototype, {
continue;
}
}
if (self.body[i] instanceof AST_EmptyStatement) {
self.body.splice(i, 1);
continue;
}
if (self.body[i] instanceof AST_BlockStatement) {
var tmp = [ i, 1 ].concat(self.body[i].body);
self.body.splice.apply(self.body, tmp);
continue;
}
break;
}
defs = make_node(AST_Var, self, {