Simplify iife new fix

as suggested by @rvanvelzen.

Added a test for IIFEs in nested contexts.
This commit is contained in:
kzc
2016-05-15 19:12:17 -04:00
parent bcc1318d4b
commit 5f464b41e2
2 changed files with 33 additions and 3 deletions

View File

@@ -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,