statement would get discarded. The current implementation adds some
overhead (compression will be slower).
+- `drop_console` -- default `false`. Pass `true` to discard calls to
+ `console.*` functions.
+
### The `unsafe` option
It enables some transformations that *might* break code logic in certain
pure_funcs : null,
negate_iife : !false_by_default,
screw_ie8 : false,
+ drop_console : false,
warnings : true,
global_defs : {}
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];
});