aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-07-31 01:09:19 +0100
committerGitHub <noreply@github.com>2020-07-31 08:09:19 +0800
commit88423f2574bfd4f158caab1c08a5a5bf1718cab4 (patch)
tree57bf9646a755320b038d1cd0799758ff2c0741dd /test/compress
parentee632a5519078ac3fe97d0864731bea4bdad9365 (diff)
downloadtracifyjs-88423f2574bfd4f158caab1c08a5a5bf1718cab4.tar.gz
tracifyjs-88423f2574bfd4f158caab1c08a5a5bf1718cab4.zip
validate against multiple parents on `AST_Node` (#4032)
- fix related issues in `global_defs`, `ie8` & `reduce_vars`
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/global_defs.js14
-rw-r--r--test/compress/ie8.js23
2 files changed, 37 insertions, 0 deletions
diff --git a/test/compress/global_defs.js b/test/compress/global_defs.js
index f1ef81d9..006be292 100644
--- a/test/compress/global_defs.js
+++ b/test/compress/global_defs.js
@@ -12,6 +12,20 @@ must_replace: {
}
}
+repeated_nodes: {
+ options = {
+ global_defs: {
+ "@N": "rand()",
+ },
+ }
+ input: {
+ console.log(N, N);
+ }
+ expect: {
+ console.log(rand(), rand());
+ }
+}
+
keyword: {
options = {
global_defs: {
diff --git a/test/compress/ie8.js b/test/compress/ie8.js
index 19437074..6c0aa9e8 100644
--- a/test/compress/ie8.js
+++ b/test/compress/ie8.js
@@ -2691,3 +2691,26 @@ issue_4028: {
}
expect_stdout: "string"
}
+
+issue_2737: {
+ options = {
+ ie8: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ (function(a) {
+ a();
+ })(function f() {
+ console.log(typeof f);
+ });
+ }
+ expect: {
+ (function(a) {
+ a();
+ })(function f() {
+ console.log(typeof f);
+ });
+ }
+ expect_stdout: "function"
+}