diff --git a/lib/compress.js b/lib/compress.js index 6e766fb0..7c60b763 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -693,7 +693,7 @@ merge(Compressor.prototype, { return node instanceof AST_SymbolRef && node.definition().undeclared; } - var global_names = makePredicate("Array Boolean console Error Function Math Number RegExp Object String"); + var global_names = makePredicate("Array Boolean console Date Error Function Math Number RegExp Object String"); AST_SymbolRef.DEFMETHOD("is_declared", function(compressor) { return !this.definition().undeclared || compressor.option("unsafe") && global_names(this.name); diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js index abf5297c..bee7994e 100644 --- a/test/compress/dead-code.js +++ b/test/compress/dead-code.js @@ -241,6 +241,7 @@ issue_2233_1: { Array.isArray; Boolean; console.log; + Date; Error.name; Function.length; Math.random;