aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorkzc <kzc@users.noreply.github.com>2017-09-06 14:44:26 -0400
committerAlex Lam S.L <alexlamsl@gmail.com>2017-09-07 02:44:26 +0800
commit8b890721903a0a983ffe74a3cecc6b922fa0518e (patch)
treefb3d290111a4b45384494bbf1fd0c0147eb07552 /lib/compress.js
parent395a17ccda95362b1a7a5bd9ac0e6cda7f0946a8 (diff)
downloadtracifyjs-8b890721903a0a983ffe74a3cecc6b922fa0518e.tar.gz
tracifyjs-8b890721903a0a983ffe74a3cecc6b922fa0518e.zip
add `Date` and other known globals to `unsafe` compress option (#2302)
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 6e766fb0..3da7a315 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 clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError");
AST_SymbolRef.DEFMETHOD("is_declared", function(compressor) {
return !this.definition().undeclared
|| compressor.option("unsafe") && global_names(this.name);