aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index e347169e..70ee9363 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -54,6 +54,7 @@ function Compressor(options, false_by_default) {
comparisons : !false_by_default,
conditionals : !false_by_default,
dead_code : !false_by_default,
+ directives : !false_by_default,
drop_console : false,
drop_debugger : !false_by_default,
evaluate : !false_by_default,
@@ -3264,8 +3265,10 @@ merge(Compressor.prototype, {
/* -----[ optimizers ]----- */
+ var directives = makePredicate(["use asm", "use strict"]);
OPT(AST_Directive, function(self, compressor) {
- if (compressor.has_directive(self.value) !== self) {
+ if (compressor.option("directives")
+ && (!directives[self.value] || compressor.has_directive(self.value) !== self)) {
return make_node(AST_EmptyStatement, self);
}
return self;