aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorkzc <zaxxon2011@gmail.com>2016-05-09 03:19:28 -0400
committerkzc <zaxxon2011@gmail.com>2016-05-09 03:19:28 -0400
commitbcc1318d4b7275feee02f782700d6b6e4a68b54f (patch)
treea79a1c2a80956dfea46377bceb010da8808add74 /lib
parenta0e03c9df47c411a40bceef02af2ce3dd1a329cc (diff)
downloadtracifyjs-bcc1318d4b7275feee02f782700d6b6e4a68b54f.tar.gz
tracifyjs-bcc1318d4b7275feee02f782700d6b6e4a68b54f.zip
Do not apply negate_iife optimization to `new` expression
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 2bcfcf30..1d6a943b 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -811,6 +811,11 @@ 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) {
+ return node;
+ }
if (node instanceof AST_Call && node.expression instanceof AST_Function) {
return make_node(AST_UnaryPrefix, node, {
operator: "!",