No need for parens for new expressions without args

This commit is contained in:
Amjad Masad 2015-11-24 19:07:03 -08:00
parent 58f512f7c4
commit d32fae6fcd
3 changed files with 4 additions and 0 deletions

View File

@ -62,6 +62,8 @@ export function ConditionalExpression(node: Object) {
export function NewExpression(node: Object) {
this.push("new ");
this.print(node.callee, node);
if (node.arguments.length === 0 && this.format.compact) return;
this.push("(");
this.printList(node.arguments, node);
this.push(")");

View File

@ -0,0 +1 @@
new X();

View File

@ -0,0 +1 @@
new X;