From: thorn0 Date: Sat, 18 Jan 2014 13:16:43 +0000 (+0200) Subject: Advanced way to specify if a function call might have side effects. #400 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=252fc65558e40e5e0a451f8fe3f2d5ae7a639457;p=UglifyJS.git Advanced way to specify if a function call might have side effects. #400 --- diff --git a/lib/compress.js b/lib/compress.js index 4c4cf977..401a1c75 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -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; });