aboutsummaryrefslogtreecommitdiff
path: root/test/compress/global_defs.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-04-08 16:46:25 +0800
committerGitHub <noreply@github.com>2017-04-08 16:46:25 +0800
commit0479ff0c54e8eea90ff5471bd9f77cb7f2e355c3 (patch)
tree539a0a54ad70a0792e58d7b22578234ac6cf36b2 /test/compress/global_defs.js
parentcf72fe552f5a51ccfe40c32e0fb86d549e0ca848 (diff)
downloadtracifyjs-0479ff0c54e8eea90ff5471bd9f77cb7f2e355c3.tar.gz
tracifyjs-0479ff0c54e8eea90ff5471bd9f77cb7f2e355c3.zip
fix a couple of bugs in `global_defs` (#1802)
- `optimize()` substituted expression - compute nested property string correctly fixes #1801 Miscellaneous - reset optimisation flags on all node types
Diffstat (limited to 'test/compress/global_defs.js')
-rw-r--r--test/compress/global_defs.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/compress/global_defs.js b/test/compress/global_defs.js
index a69d031e..f1ba8f32 100644
--- a/test/compress/global_defs.js
+++ b/test/compress/global_defs.js
@@ -145,3 +145,18 @@ mixed: {
'WARN: global_defs CONFIG.VALUE redefined [test/compress/global_defs.js:129,8]',
]
}
+
+issue_1801: {
+ options = {
+ booleans: true,
+ global_defs: {
+ "CONFIG.FOO.BAR": true,
+ },
+ }
+ input: {
+ console.log(CONFIG.FOO.BAR);
+ }
+ expect: {
+ console.log(!0);
+ }
+}