(
this: Parser,
node: Undone<N.ArrowFunctionExpression>,
params:
| (
| N.Expression
| N.SpreadElement
| N.VoidPattern
| N.AssignmentPattern
| N.ArgumentPlaceholder
| N.TSTypeCastExpression
)[]
| (
| N.Expression
| N.RestElement
| N.VoidPattern
| N.AssignmentPattern
| N.ArgumentPlaceholder
| N.TSTypeCastExpression
)[]
| null
| undefined,
isAsync: boolean,
trailingCommaLoc?: Position | null,
)
| 2518 | // If the parameters are provided, they will be converted to an |
| 2519 | // assignable list. |
| 2520 | parseArrowExpression( |
| 2521 | this: Parser, |
| 2522 | node: Undone<N.ArrowFunctionExpression>, |
| 2523 | params: |
| 2524 | | ( |
| 2525 | | N.Expression |
| 2526 | | N.SpreadElement |
| 2527 | | N.VoidPattern |
| 2528 | | N.AssignmentPattern |
| 2529 | | N.ArgumentPlaceholder |
| 2530 | | N.TSTypeCastExpression |
| 2531 | )[] |
| 2532 | | ( |
| 2533 | | N.Expression |
| 2534 | | N.RestElement |
| 2535 | | N.VoidPattern |
| 2536 | | N.AssignmentPattern |
| 2537 | | N.ArgumentPlaceholder |
| 2538 | | N.TSTypeCastExpression |
| 2539 | )[] |
| 2540 | | null |
| 2541 | | undefined, |
| 2542 | isAsync: boolean, |
| 2543 | trailingCommaLoc?: Position | null, |
| 2544 | ): N.ArrowFunctionExpression { |
| 2545 | this.scope.enter(ScopeFlag.FUNCTION | ScopeFlag.ARROW); |
| 2546 | let flags = functionFlags(isAsync, false); |
| 2547 | // ConciseBody[In] : |
| 2548 | // [lookahead ≠ {] ExpressionBody[?In, ~Await] |
| 2549 | // { FunctionBody[~Yield, ~Await] } |
| 2550 | const hasBlockBody = this.match(tt.braceL); |
| 2551 | if (!hasBlockBody) { |
| 2552 | flags |= |
| 2553 | this.prodParam.currentFlags() & |
| 2554 | (ParamKind.PARAM_IN | ParamKind.PARAM_NOT_FSHARP_PIPELINE_DIRECT_BODY); |
| 2555 | } |
| 2556 | this.prodParam.enter(flags); |
| 2557 | this.initFunction(node, isAsync); |
| 2558 | |
| 2559 | if (params) { |
| 2560 | this.setArrowFunctionParameters(node, params, trailingCommaLoc); |
| 2561 | } |
| 2562 | this.parseFunctionBody(node, true); |
| 2563 | if (hasBlockBody) { |
| 2564 | this.state.regExpAllowedAt = this.state.lastTokEndLoc!.index; |
| 2565 | } |
| 2566 | |
| 2567 | this.prodParam.exit(); |
| 2568 | this.scope.exit(); |
| 2569 | |
| 2570 | return this.finishNode(node, "ArrowFunctionExpression"); |
| 2571 | } |
| 2572 | |
| 2573 | setArrowFunctionParameters( |
| 2574 | node: Undone<N.ArrowFunctionExpression>, |
nothing calls this directly
no test coverage detected