aboutsummaryrefslogtreecommitdiff
path: root/test/compress/dead-code.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 /test/compress/dead-code.js
parent395a17ccda95362b1a7a5bd9ac0e6cda7f0946a8 (diff)
downloadtracifyjs-8b890721903a0a983ffe74a3cecc6b922fa0518e.tar.gz
tracifyjs-8b890721903a0a983ffe74a3cecc6b922fa0518e.zip
add `Date` and other known globals to `unsafe` compress option (#2302)
Diffstat (limited to 'test/compress/dead-code.js')
-rw-r--r--test/compress/dead-code.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js
index abf5297c..aea0e540 100644
--- a/test/compress/dead-code.js
+++ b/test/compress/dead-code.js
@@ -241,18 +241,54 @@ issue_2233_1: {
Array.isArray;
Boolean;
console.log;
+ Date;
+ decodeURI;
+ decodeURIComponent;
+ encodeURI;
+ encodeURIComponent;
Error.name;
+ escape;
+ eval;
+ EvalError;
Function.length;
+ isFinite;
+ isNaN;
+ JSON;
Math.random;
Number.isNaN;
+ parseFloat;
+ parseInt;
RegExp;
Object.defineProperty;
String.fromCharCode;
+ RangeError;
+ ReferenceError;
+ SyntaxError;
+ TypeError;
+ unescape;
+ URIError;
}
expect: {}
expect_stdout: true
}
+global_timeout_and_interval_symbols: {
+ options = {
+ pure_getters: "strict",
+ side_effects: true,
+ unsafe: true,
+ }
+ input: {
+ // These global symbols do not exist in the test sandbox
+ // and must be tested separately.
+ clearInterval;
+ clearTimeout;
+ setInterval;
+ setTimeout;
+ }
+ expect: {}
+}
+
issue_2233_2: {
options = {
pure_getters: "strict",