aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-05-22 01:38:43 +0800
committerGitHub <noreply@github.com>2017-05-22 01:38:43 +0800
commitefdb65913b45fc9a64fc65df3a03c8c5a7827e53 (patch)
tree6f380f405ce6eba6a3f715c4e0bbbc9c5593c17d /test/compress
parenta1dedeb3ceb41b6419f877d34228cf0ba4b040a2 (diff)
downloadtracifyjs-efdb65913b45fc9a64fc65df3a03c8c5a7827e53.tar.gz
tracifyjs-efdb65913b45fc9a64fc65df3a03c8c5a7827e53.zip
improve usability of `global_defs` in `minify()` (#1987)
Use `@key` to `parse()` string value as `AST_Node`. fixes #1986
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/global_defs.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/compress/global_defs.js b/test/compress/global_defs.js
index bfd1d5f6..d784d335 100644
--- a/test/compress/global_defs.js
+++ b/test/compress/global_defs.js
@@ -160,3 +160,17 @@ issue_1801: {
console.log(!0);
}
}
+
+issue_1986: {
+ options = {
+ global_defs: {
+ "@alert": "console.log",
+ },
+ }
+ input: {
+ alert(42);
+ }
+ expect: {
+ console.log(42);
+ }
+}