From f01cc1e413990a2da37716fbe8627d651f489fff Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sun, 21 Apr 2019 09:49:07 +0800 Subject: unwind IIFE class patterns (#3373) fixes #2332 --- test/compress/collapse_vars.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/compress/collapse_vars.js') 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", + ] +} -- cgit v1.2.3