aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorthorn0 <georgii.dolzhykov@stuzo.com>2014-01-18 15:16:43 +0200
committerRichard van Velzen <rvanvelzen@experty.com>2015-07-29 14:36:42 +0200
commit252fc65558e40e5e0a451f8fe3f2d5ae7a639457 (patch)
tree50ce28459bb74e7e45c78e49b3ac0a2643b3b3b4 /lib/compress.js
parentba9936a5725f35c3d3452bf3aeba4055de1a1071 (diff)
downloadtracifyjs-252fc65558e40e5e0a451f8fe3f2d5ae7a639457.tar.gz
tracifyjs-252fc65558e40e5e0a451f8fe3f2d5ae7a639457.zip
Advanced way to specify if a function call might have side effects. #400
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js1
1 files changed, 1 insertions, 0 deletions
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;
});