Skip to content

Commit

Permalink
Ensure that the arrow nodes have a location before using them. (#9003)
Browse files Browse the repository at this point in the history
  • Loading branch information
loganfsmyth committed Nov 13, 2018
1 parent 4fcee17 commit cbbb3c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/babel-generator/src/generators/methods.js
Expand Up @@ -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();
Expand Down

0 comments on commit cbbb3c7

Please sign in to comment.