(this: Parser)
| 626 | } |
| 627 | |
| 628 | parseHackPipeBody(this: Parser): N.Expression { |
| 629 | const { startLoc } = this.state; |
| 630 | const body = this.parseMaybeAssign(); |
| 631 | const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has( |
| 632 | // @ts-expect-error TS2345: Argument of type 'string' is not assignable to parameter of type '"ArrowFunctionExpression" | "YieldExpression" | "AssignmentExpression" | "ConditionalExpression"'. |
| 633 | body.type, |
| 634 | ); |
| 635 | |
| 636 | // TODO: Check how to handle type casts in Flow and TS once they are supported |
| 637 | if (requiredParentheses && !body.extra?.parenthesized) { |
| 638 | this.raise(Errors.PipeUnparenthesizedBody, startLoc, { |
| 639 | type: body.type as UnparenthesizedPipeBodyTypes, |
| 640 | }); |
| 641 | } |
| 642 | if (!this.topicReferenceWasUsedInCurrentContext()) { |
| 643 | // A Hack pipe body must use the topic reference at least once. |
| 644 | this.raise(Errors.PipeTopicUnused, startLoc); |
| 645 | } |
| 646 | |
| 647 | return body; |
| 648 | } |
| 649 | |
| 650 | checkExponentialAfterUnary( |
| 651 | node: N.AwaitExpression | Undone<N.UnaryExpression>, |
nothing calls this directly
no test coverage detected