(ast: o.ArrowFunctionExpr, ctx: EmitterVisitorContext)
| 450 | } |
| 451 | |
| 452 | visitArrowFunctionExpr(ast: o.ArrowFunctionExpr, ctx: EmitterVisitorContext): void { |
| 453 | this.printLeadingComments(ast, ctx); |
| 454 | ctx.print(ast, '('); |
| 455 | this.visitParams(ast.params, ctx); |
| 456 | ctx.print(ast, ')'); |
| 457 | ast.type?.visitType(this, ctx); |
| 458 | ctx.print(ast, ' => '); |
| 459 | |
| 460 | if (Array.isArray(ast.body)) { |
| 461 | ctx.print(ast, `{`); |
| 462 | ctx.println(ast); |
| 463 | ctx.incIndent(); |
| 464 | this.visitAllStatements(ast.body, ctx); |
| 465 | ctx.decIndent(); |
| 466 | ctx.println(ast, `}`); |
| 467 | } else { |
| 468 | const shouldParenthesize = this.shouldParenthesize(ast.body, ast); |
| 469 | |
| 470 | if (shouldParenthesize) { |
| 471 | ctx.print(ast, '('); |
| 472 | } |
| 473 | |
| 474 | ast.body.visitExpression(this, ctx); |
| 475 | |
| 476 | if (shouldParenthesize) { |
| 477 | ctx.print(ast, ')'); |
| 478 | } |
| 479 | } |
| 480 | } |
| 481 | |
| 482 | visitDeclareFunctionStmt(stmt: o.DeclareFunctionStmt, ctx: EmitterVisitorContext): void { |
| 483 | this.printLeadingComments(stmt, ctx); |
nothing calls this directly
no test coverage detected