Advanced way to specify if a function call might have side effects. #400

This commit is contained in:
thorn0
2014-01-18 15:16:43 +02:00
committed by Richard van Velzen
parent ba9936a572
commit 252fc65558

View File

@@ -896,6 +896,7 @@ merge(Compressor.prototype, {
def(AST_Call, function(compressor){
var pure = compressor.option("pure_funcs");
if (!pure) return true;
if (typeof pure == "function") return pure(this);
return pure.indexOf(this.expression.print_to_string()) < 0;
});