(ast: o.ArrowFunctionExpr, ctx: EmitterVisitorContext)
| 428 | } |
| 429 | |
| 430 | visitArrowFunctionExpr(ast: o.ArrowFunctionExpr, ctx: EmitterVisitorContext): void { |
| 431 | this.printLeadingComments(ast, ctx); |
| 432 | ctx.print(ast, '('); |
| 433 | this.visitParams(ast.params, ctx); |
| 434 | ctx.print(ast, ')'); |
| 435 | ast.type?.visitType(this, ctx); |
| 436 | ctx.print(ast, ' => '); |
| 437 | |
| 438 | if (Array.isArray(ast.body)) { |
| 439 | ctx.print(ast, `{`); |
| 440 | ctx.println(ast); |
| 441 | ctx.incIndent(); |
| 442 | this.visitAllStatements(ast.body, ctx); |
| 443 | ctx.decIndent(); |
| 444 | ctx.println(ast, `}`); |
| 445 | } else { |
| 446 | const shouldParenthesize = this.shouldParenthesize(ast.body, ast); |
| 447 | |
| 448 | if (shouldParenthesize) { |
| 449 | ctx.print(ast, '('); |
| 450 | } |
| 451 | |
| 452 | ast.body.visitExpression(this, ctx); |
| 453 | |
| 454 | if (shouldParenthesize) { |
| 455 | ctx.print(ast, ')'); |
| 456 | } |
| 457 | } |
| 458 | } |
| 459 | |
| 460 | visitDeclareFunctionStmt(stmt: o.DeclareFunctionStmt, ctx: EmitterVisitorContext): void { |
| 461 | this.printLeadingComments(stmt, ctx); |
nothing calls this directly
no test coverage detected
searching dependent graphs…