From: Mihai Bazon Date: Wed, 7 Nov 2012 09:36:15 +0000 (+0200) Subject: parenthesize a Call expression when its parent is New X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=ff388a8d2d6f7777690e792e8cb497acb108e3e5;p=UglifyJS.git parenthesize a Call expression when its parent is New fix #35 --- 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();