aboutsummaryrefslogtreecommitdiff
path: root/test/compress/global_defs.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-06-27 10:31:19 +0800
committerGitHub <noreply@github.com>2017-06-27 10:31:19 +0800
commit1e4de2e6d31a50dafee4a4e4d020f22691d22292 (patch)
tree3d7b4b249ecfb6c7a4d61290136d7340b60d2842 /test/compress/global_defs.js
parent8b4dcd8f3e673209cd56ee44cc0292b4bcf60559 (diff)
downloadtracifyjs-1e4de2e6d31a50dafee4a4e4d020f22691d22292.tar.gz
tracifyjs-1e4de2e6d31a50dafee4a4e4d020f22691d22292.zip
parse `@global_defs` as expressions (#2169)
- let parser rejects non-conformant input - eliminate need for extraneous parenthesis
Diffstat (limited to 'test/compress/global_defs.js')
-rw-r--r--test/compress/global_defs.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/global_defs.js b/test/compress/global_defs.js
index d784d335..74147ded 100644
--- a/test/compress/global_defs.js
+++ b/test/compress/global_defs.js
@@ -174,3 +174,24 @@ issue_1986: {
console.log(42);
}
}
+
+issue_2167: {
+ options = {
+ conditionals: true,
+ dead_code: true,
+ evaluate: true,
+ global_defs: {
+ "@isDevMode": "function(){}",
+ },
+ side_effects: true,
+ }
+ input: {
+ if (isDevMode()) {
+ greetOverlord();
+ }
+ doWork();
+ }
+ expect: {
+ doWork();
+ }
+}