Ensure that the arrow nodes have a location before using them. (#9003)
This commit is contained in:
parent
4fcee1751a
commit
cbbb3c7962
@ -113,10 +113,12 @@ export function ArrowFunctionExpression(node: Object) {
|
|||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
this.format.retainLines &&
|
this.format.retainLines &&
|
||||||
|
node.loc &&
|
||||||
|
node.body.loc &&
|
||||||
node.loc.start.line < node.body.loc.start.line
|
node.loc.start.line < node.body.loc.start.line
|
||||||
) {
|
) {
|
||||||
this.token("(");
|
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.indent();
|
||||||
this.print(firstParam, node);
|
this.print(firstParam, node);
|
||||||
this.dedent();
|
this.dedent();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user