MCPcopy
hub / github.com/angular/angular / visitArrowFunctionExpr

Function visitArrowFunctionExpr

packages/compiler/src/output/abstract_emitter.ts:430–458  ·  view source on GitHub ↗
(ast: o.ArrowFunctionExpr, ctx: EmitterVisitorContext)

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 8

isArrayMethod · 0.80
printlnMethod · 0.80
visitAllStatementsMethod · 0.80
printMethod · 0.45
visitTypeMethod · 0.45
incIndentMethod · 0.45
decIndentMethod · 0.45
visitExpressionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…