diff --git a/packages/babel-generator/src/generators/methods.js b/packages/babel-generator/src/generators/methods.js index 9d9f68733380..1019aba04c7c 100644 --- a/packages/babel-generator/src/generators/methods.js +++ b/packages/babel-generator/src/generators/methods.js @@ -113,10 +113,12 @@ export function ArrowFunctionExpression(node: Object) { ) { if ( this.format.retainLines && + node.loc && + node.body.loc && node.loc.start.line < node.body.loc.start.line ) { this.token("("); - if (firstParam.loc.start.line > node.loc.start.line) { + if (firstParam.loc && firstParam.loc.start.line > node.loc.start.line) { this.indent(); this.print(firstParam, node); this.dedent();