Advanced way to specify if a function call might have side effects. #400
This commit is contained in:
parent
ba9936a572
commit
252fc65558
|
|
@ -896,6 +896,7 @@ merge(Compressor.prototype, {
|
||||||
def(AST_Call, function(compressor){
|
def(AST_Call, function(compressor){
|
||||||
var pure = compressor.option("pure_funcs");
|
var pure = compressor.option("pure_funcs");
|
||||||
if (!pure) return true;
|
if (!pure) return true;
|
||||||
|
if (typeof pure == "function") return pure(this);
|
||||||
return pure.indexOf(this.expression.print_to_string()) < 0;
|
return pure.indexOf(this.expression.print_to_string()) < 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user