diff options
author | kzc <zaxxon2011@gmail.com> | 2016-05-15 19:12:17 -0400 |
---|---|---|
committer | kzc <zaxxon2011@gmail.com> | 2016-05-15 19:12:17 -0400 |
commit | 5f464b41e2ba95f4d81da262a260488d326eb633 (patch) | |
tree | afd36d2c2e2342279e5b0b01e79401b338737a42 /lib | |
parent | bcc1318d4b7275feee02f782700d6b6e4a68b54f (diff) | |
download | tracifyjs-5f464b41e2ba95f4d81da262a260488d326eb633.tar.gz tracifyjs-5f464b41e2ba95f4d81da262a260488d326eb633.zip |
Simplify iife `new` fix
as suggested by @rvanvelzen.
Added a test for IIFEs in nested contexts.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compress.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/compress.js b/lib/compress.js index 1d6a943b..6436796f 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -811,9 +811,7 @@ merge(Compressor.prototype, { if (stat instanceof AST_SimpleStatement) { stat.body = (function transform(thing) { return thing.transform(new TreeTransformer(function(node){ - if (node instanceof AST_New - && node.expression instanceof AST_Call - && node.expression.expression instanceof AST_Function) { + if (node instanceof AST_New) { return node; } if (node instanceof AST_Call && node.expression instanceof AST_Function) { |