diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-04-21 09:49:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-21 09:49:07 +0800 |
commit | f01cc1e413990a2da37716fbe8627d651f489fff (patch) | |
tree | 9ff84e40e7fabfb16d0fd63af9d4ead6bee72d02 /test/compress/collapse_vars.js | |
parent | 338dd144b8fedd91f0fd33c068984877527614cc (diff) | |
download | tracifyjs-f01cc1e413990a2da37716fbe8627d651f489fff.tar.gz tracifyjs-f01cc1e413990a2da37716fbe8627d651f489fff.zip |
unwind IIFE class patterns (#3373)
fixes #2332
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r-- | test/compress/collapse_vars.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index 22a8d7ae..470f3b76 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -6157,3 +6157,24 @@ sub_property: { } expect_stdout: "PASS" } + +assign_undeclared: { + options = { + collapse_vars: true, + toplevel: true, + unused: true, + } + input: { + var A = (console.log(42), function() {}); + B = new A(); + console.log(typeof B); + } + expect: { + B = new (console.log(42), function() {})(); + console.log(typeof B); + } + expect_stdout: [ + "42", + "object", + ] +} |