aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRichard van Velzen <rvanvelzen@experty.com>2016-09-30 12:27:45 +0200
committerRichard van Velzen <rvanvelzen@experty.com>2016-10-06 14:11:32 +0200
commite05510f3bce78943f76649a4102c2f10bfccdaef (patch)
tree9e18dff4a3af126d4c85633e6561af5a6bc15b94 /test
parentfc9804b90955d3b38ac6e6c903a8c0e3f7945913 (diff)
downloadtracifyjs-e05510f3bce78943f76649a4102c2f10bfccdaef.tar.gz
tracifyjs-e05510f3bce78943f76649a4102c2f10bfccdaef.zip
Add an option to wrap IIFEs in parenthesis
For #1307.
Diffstat (limited to 'test')
-rw-r--r--test/compress/wrap_iife.js33
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")})()})()();'
+}