diff options
author | Richard van Velzen <rvanvelzen@experty.com> | 2016-09-30 12:27:45 +0200 |
---|---|---|
committer | Richard van Velzen <rvanvelzen@experty.com> | 2016-10-06 14:11:32 +0200 |
commit | e05510f3bce78943f76649a4102c2f10bfccdaef (patch) | |
tree | 9e18dff4a3af126d4c85633e6561af5a6bc15b94 /test/compress/wrap_iife.js | |
parent | fc9804b90955d3b38ac6e6c903a8c0e3f7945913 (diff) | |
download | tracifyjs-e05510f3bce78943f76649a4102c2f10bfccdaef.tar.gz tracifyjs-e05510f3bce78943f76649a4102c2f10bfccdaef.zip |
Add an option to wrap IIFEs in parenthesis
For #1307.
Diffstat (limited to 'test/compress/wrap_iife.js')
-rw-r--r-- | test/compress/wrap_iife.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/compress/wrap_iife.js b/test/compress/wrap_iife.js new file mode 100644 index 00000000..b1b88ac1 --- /dev/null +++ b/test/compress/wrap_iife.js @@ -0,0 +1,33 @@ +wrap_iife: { + options = { + negate_iife: false, + } + beautify = { + wrap_iife: true, + } + input: { + (function() { + return function() { + console.log('test') + }; + })()(); + } + expect_exact: '(function(){return function(){console.log("test")}})()();' +} + +wrap_iife_in_return_call: { + options = { + negate_iife: false, + } + beautify = { + wrap_iife: true, + } + input: { + (function() { + return (function() { + console.log('test') + })(); + })()(); + } + expect_exact: '(function(){return(function(){console.log("test")})()})()();' +} |