allow functions with no symbols

This commit is contained in:
alexlamsl 2017-11-29 06:29:02 +08:00
parent 3497a99182
commit cdf6ce5f66

View File

@ -2264,11 +2264,14 @@ merge(Compressor.prototype, {
def(AST_Constant, return_true);
def(AST_Lambda, function(scope){
var self = this;
if (self.inlined) return false;
var result = true;
self.walk(new TreeWalker(function(node) {
if (!result) return true;
if (node instanceof AST_SymbolRef) {
if (self.inlined) {
result = false;
return true;
}
var def = node.definition();
if (member(def, self.enclosed)
&& !self.variables.has(def.name)) {