diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-07-31 01:09:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-31 08:09:19 +0800 |
commit | 88423f2574bfd4f158caab1c08a5a5bf1718cab4 (patch) | |
tree | 57bf9646a755320b038d1cd0799758ff2c0741dd /test/compress | |
parent | ee632a5519078ac3fe97d0864731bea4bdad9365 (diff) | |
download | tracifyjs-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.js | 14 | ||||
-rw-r--r-- | test/compress/ie8.js | 23 |
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" +} |