further fix for parens around New (refs #35)

This commit is contained in:
Mihai Bazon
2012-11-07 11:49:06 +02:00
parent ff388a8d2d
commit a90c1aeafe

View File

@@ -475,8 +475,9 @@ function OutputStream(options) {
PARENS(AST_New, function(output){ PARENS(AST_New, function(output){
var p = output.parent(); var p = output.parent();
// (new Date).getTime(); if (no_constructor_parens(this, output)
if (p instanceof AST_Dot && no_constructor_parens(this, output)) && (p instanceof AST_Dot // (new Date).getTime()
|| p instanceof AST_Call && p.expression === this)) // (new foo)(bar)
return true; return true;
}); });