inline single-use function across loop (#2594)
This commit is contained in:
@@ -3862,12 +3862,15 @@ merge(Compressor.prototype, {
|
||||
}
|
||||
}
|
||||
if (fn instanceof AST_Function) {
|
||||
var def;
|
||||
if (compressor.option("inline")
|
||||
&& exp === fn
|
||||
&& !fn.name
|
||||
&& !fn.uses_arguments
|
||||
&& !fn.uses_eval
|
||||
&& fn.body.length == 1
|
||||
&& (exp === fn ? !fn.name
|
||||
: compressor.option("unused")
|
||||
&& (def = exp.definition()).references.length == 1
|
||||
&& !recursive_ref(compressor, def))
|
||||
&& !fn.contains_this()
|
||||
&& all(fn.argnames, function(arg) {
|
||||
return arg.__unused;
|
||||
|
||||
Reference in New Issue
Block a user