From: Mihai Bazon Date: Wed, 7 Nov 2012 09:49:06 +0000 (+0200) Subject: further fix for parens around New (refs #35) X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a90c1aeafe0ab94cb20e0f0f40fda2b740a3bb15;p=UglifyJS.git further fix for parens around New (refs #35) --- diff --git a/lib/output.js b/lib/output.js index 22ee31e4..2a177684 100644 --- a/lib/output.js +++ b/lib/output.js @@ -475,8 +475,9 @@ function OutputStream(options) { PARENS(AST_New, function(output){ var p = output.parent(); - // (new Date).getTime(); - if (p instanceof AST_Dot && no_constructor_parens(this, output)) + if (no_constructor_parens(this, output) + && (p instanceof AST_Dot // (new Date).getTime() + || p instanceof AST_Call && p.expression === this)) // (new foo)(bar) return true; });