Remove console.log and add extra test case
authorRichard van Velzen <rvanvelzen@experty.com>
Thu, 6 Oct 2016 12:11:19 +0000 (14:11 +0200)
committerRichard van Velzen <rvanvelzen@experty.com>
Thu, 6 Oct 2016 12:11:32 +0000 (14:11 +0200)
lib/output.js
test/compress/wrap_iife.js

index c20a036..014dac4 100644 (file)
@@ -559,7 +559,6 @@ function OutputStream(options) {
 
         if (output.option('wrap_iife')) {
             var p = output.parent();
-            console.log()
             return p instanceof AST_Call && p.expression === this;
         }
 
index b1b88ac..5c45853 100644 (file)
@@ -15,6 +15,21 @@ wrap_iife: {
     expect_exact: '(function(){return function(){console.log("test")}})()();'
 }
 
+wrap_iife_in_expression: {
+    options = {
+        negate_iife: false,
+    }
+    beautify = {
+        wrap_iife: true,
+    }
+    input: {
+        foo = (function () {
+            return bar();
+        })();
+    }
+    expect_exact: 'foo=(function(){return bar()})();'
+}
+
 wrap_iife_in_return_call: {
     options = {
         negate_iife: false,