Handle member expressions
This commit is contained in:
parent
f1f6c820fe
commit
486d781be3
@ -62,7 +62,8 @@ export function ConditionalExpression(node: Object) {
|
||||
export function NewExpression(node: Object, parent: Object) {
|
||||
this.push("new ");
|
||||
this.print(node.callee, node);
|
||||
if (node.arguments.length === 0 && this.format.compact && !t.isCallExpression(parent)) return;
|
||||
if (node.arguments.length === 0 && this.format.compact &&
|
||||
!t.isCallExpression(parent) && !t.isMemberExpression(parent)) return;
|
||||
|
||||
this.push("(");
|
||||
this.printList(node.arguments, node);
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
new X();
|
||||
new Y()();
|
||||
new F().z;
|
||||
|
||||
@ -1 +1 @@
|
||||
new X;new Y()();
|
||||
new X;new Y()();new F().z;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user