aboutsummaryrefslogtreecommitdiff
path: root/test/compress/collapse_vars.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-04-21 09:49:07 +0800
committerGitHub <noreply@github.com>2019-04-21 09:49:07 +0800
commitf01cc1e413990a2da37716fbe8627d651f489fff (patch)
tree9ff84e40e7fabfb16d0fd63af9d4ead6bee72d02 /test/compress/collapse_vars.js
parent338dd144b8fedd91f0fd33c068984877527614cc (diff)
downloadtracifyjs-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.js21
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",
+ ]
+}