Merge pull request #3311 from babel/object-body
[T7047] Consider arrow functions when parenthesizing object expressions
This commit is contained in:
@@ -77,15 +77,5 @@ export function ArrowFunctionExpression(node: Object) {
|
||||
|
||||
this.push(" => ");
|
||||
|
||||
const bodyNeedsParens = t.isObjectExpression(node.body);
|
||||
|
||||
if (bodyNeedsParens) {
|
||||
this.push("(");
|
||||
}
|
||||
|
||||
this.print(node.body, node);
|
||||
|
||||
if (bodyNeedsParens) {
|
||||
this.push(")");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user