Fix output of statement: `new function(){...};`
authorMihai Bazon <mihai@bazon.net>
Mon, 20 May 2013 05:27:37 +0000 (08:27 +0300)
committerMihai Bazon <mihai@bazon.net>
Mon, 20 May 2013 05:27:37 +0000 (08:27 +0300)
Close #209

lib/output.js

index a13c92e..b510cb3 100644 (file)
@@ -1122,7 +1122,7 @@ function OutputStream(options) {
             if (p instanceof AST_Statement && p.body === node)
                 return true;
             if ((p instanceof AST_Seq           && p.car === node        ) ||
-                (p instanceof AST_Call          && p.expression === node ) ||
+                (p instanceof AST_Call          && p.expression === node && !(p instanceof AST_New) ) ||
                 (p instanceof AST_Dot           && p.expression === node ) ||
                 (p instanceof AST_Sub           && p.expression === node ) ||
                 (p instanceof AST_Conditional   && p.condition === node  ) ||