@@ -6278,21 +6278,24 @@ Compressor.prototype.compress = function(node) {
|
||||
var call = stat.value;
|
||||
if (!call || call.TYPE != "Call") break;
|
||||
if (call.is_expr_pure(compressor)) break;
|
||||
var fn = call.expression;
|
||||
if (fn instanceof AST_SymbolRef) {
|
||||
if (self.name && self.name.definition() === fn.definition()) break;
|
||||
fn = fn.fixed_value();
|
||||
var exp = call.expression, fn;
|
||||
if (!(exp instanceof AST_SymbolRef)) {
|
||||
fn = exp;
|
||||
} else if (self.name && self.name.definition() === exp.definition()) {
|
||||
break;
|
||||
} else {
|
||||
fn = exp.fixed_value();
|
||||
}
|
||||
if (!(fn instanceof AST_Defun || fn instanceof AST_Function)) break;
|
||||
if (fn.rest) break;
|
||||
if (fn.uses_arguments) break;
|
||||
if (fn === call.expression) {
|
||||
if (fn === exp) {
|
||||
if (fn.parent_scope !== self) break;
|
||||
if (!all(fn.enclosed, function(def) {
|
||||
return def.scope !== self;
|
||||
})) break;
|
||||
}
|
||||
if (fn.name
|
||||
if ((fn !== exp || fn.name)
|
||||
&& (parent instanceof AST_ClassMethod || parent instanceof AST_ObjectMethod)
|
||||
&& parent.value === compressor.self()) break;
|
||||
if (fn.contains_this()) break;
|
||||
@@ -6321,7 +6324,7 @@ Compressor.prototype.compress = function(node) {
|
||||
fn.argnames.push(fn.make_var(AST_SymbolFunarg, fn, "argument_" + len));
|
||||
} while (++len < self.argnames.length);
|
||||
}
|
||||
return call.expression;
|
||||
return exp;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user