From ff388a8d2d6f7777690e792e8cb497acb108e3e5 Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Wed, 7 Nov 2012 11:36:15 +0200 Subject: [PATCH] parenthesize a Call expression when its parent is New fix #35 --- lib/output.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/output.js b/lib/output.js index 46ed126e..22ee31e4 100644 --- a/lib/output.js +++ b/lib/output.js @@ -468,6 +468,11 @@ function OutputStream(options) { } }); + PARENS(AST_Call, function(output){ + var p = output.parent(); + return p instanceof AST_New && p.expression === this; + }); + PARENS(AST_New, function(output){ var p = output.parent(); // (new Date).getTime(); -- 2.34.1