aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorkzc <zaxxon2011@gmail.com>2016-05-15 19:12:17 -0400
committerkzc <zaxxon2011@gmail.com>2016-05-15 19:12:17 -0400
commit5f464b41e2ba95f4d81da262a260488d326eb633 (patch)
treeafd36d2c2e2342279e5b0b01e79401b338737a42 /test/compress
parentbcc1318d4b7275feee02f782700d6b6e4a68b54f (diff)
downloadtracifyjs-5f464b41e2ba95f4d81da262a260488d326eb633.tar.gz
tracifyjs-5f464b41e2ba95f4d81da262a260488d326eb633.zip
Simplify iife `new` fix
as suggested by @rvanvelzen. Added a test for IIFEs in nested contexts.
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/negate-iife.js32
1 files changed, 32 insertions, 0 deletions
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,