From 5f464b41e2ba95f4d81da262a260488d326eb633 Mon Sep 17 00:00:00 2001 From: kzc Date: Sun, 15 May 2016 19:12:17 -0400 Subject: Simplify iife `new` fix as suggested by @rvanvelzen. Added a test for IIFEs in nested contexts. --- test/compress/negate-iife.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'test/compress') diff --git a/test/compress/negate-iife.js b/test/compress/negate-iife.js index 20b3f56e..b73ff547 100644 --- a/test/compress/negate-iife.js +++ b/test/compress/negate-iife.js @@ -75,6 +75,38 @@ negate_iife_4: { } } +negate_iife_nested: { + options = { + negate_iife: true, + sequences: true, + conditionals: true, + }; + input: { + function Foo(f) { + this.f = f; + } + new Foo(function() { + (function(x) { + (function(y) { + console.log(y); + })(x); + })(7); + }).f(); + } + expect: { + function Foo(f) { + this.f = f; + } + new Foo(function() { + !function(x) { + !function(y) { + console.log(y); + }(x); + }(7); + }).f(); + } +} + negate_iife_issue_1073: { options = { negate_iife: true, -- cgit v1.2.3