It's only valid if the node is the callee
This commit is contained in:
parent
486d781be3
commit
c78c27a8d6
@ -63,7 +63,7 @@ export function NewExpression(node: Object, parent: Object) {
|
|||||||
this.push("new ");
|
this.push("new ");
|
||||||
this.print(node.callee, node);
|
this.print(node.callee, node);
|
||||||
if (node.arguments.length === 0 && this.format.compact &&
|
if (node.arguments.length === 0 && this.format.compact &&
|
||||||
!t.isCallExpression(parent) && !t.isMemberExpression(parent)) return;
|
!t.isCallExpression(parent, { callee: node }) && !t.isMemberExpression(parent)) return;
|
||||||
|
|
||||||
this.push("(");
|
this.push("(");
|
||||||
this.printList(node.arguments, node);
|
this.printList(node.arguments, node);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user