Add an option to wrap IIFEs in parenthesis

For #1307.
This commit is contained in:
Richard van Velzen
2016-09-30 12:27:45 +02:00
parent fc9804b909
commit e05510f3bc
3 changed files with 53 additions and 2 deletions

View File

@@ -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")})()})()();'
}