aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 4c52f4dd..2a8b4c2e 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -70,6 +70,7 @@ function Compressor(options, false_by_default) {
pure_funcs : null,
negate_iife : !false_by_default,
screw_ie8 : false,
+ drop_console : false,
warnings : true,
global_defs : {}
@@ -1773,6 +1774,14 @@ merge(Compressor.prototype, {
return make_node(AST_Undefined, self).transform(compressor);
}
}
+ if (compressor.option("drop_console")) {
+ if (self.expression instanceof AST_PropAccess &&
+ self.expression.expression instanceof AST_SymbolRef &&
+ self.expression.expression.name == "console" &&
+ self.expression.expression.undeclared()) {
+ return make_node(AST_Undefined, self).transform(compressor);
+ }
+ }
return self.evaluate(compressor)[0];
});