MCPcopy Create free account
hub / github.com/angular/angular / visitUnary

Method visitUnary

packages/compiler/src/typecheck/expression.ts:78–84  ·  view source on GitHub ↗
(ast: Unary)

Source from the content-addressed store, hash-verified

76 }
77
78 visitUnary(ast: Unary): TcbExpr {
79 // Note that we don't need to guard against sequences like `+ +a` collapsing into `++a`,
80 // because `wrapForTypeChecker` always parenthesizes nested unary expressions.
81 const expr = this.translate(ast.expr).print();
82 const node = new TcbExpr(ast.isPrefix ? `${ast.operator}${expr}` : `${expr}${ast.operator}`);
83 return node.wrapForTypeChecker().addParseSpanInfo(ast.sourceSpan);
84 }
85
86 visitBinary(ast: Binary): TcbExpr {
87 const lhs = this.translate(ast.left);

Callers

nothing calls this directly

Calls 4

translateMethod · 0.95
wrapForTypeCheckerMethod · 0.95
addParseSpanInfoMethod · 0.80
printMethod · 0.45

Tested by

no test coverage detected