MCPcopy Index your code
hub / github.com/angular/angular / TcbConditionOp

Class TcbConditionOp

packages/compiler/src/typecheck/ops/expression.ts:81–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79 * Executing this operation returns nothing.
80 */
81export class TcbConditionOp extends TcbOp {
82 constructor(
83 private tcb: Context,
84 private scope: Scope,
85 private expression: AST,
86 ) {
87 super();
88 }
89
90 override get optional() {
91 return false;
92 }
93
94 override execute(): null {
95 const expr = tcbExpression(this.expression, this.tcb, this.scope);
96 // Wrap in an if-statement to enable TS2774 for uninvoked signals/functions.
97 this.scope.addStatement(new TcbExpr(`if (${expr.print()}) {}`));
98 return null;
99 }
100}
101
102export class TcbExpressionTranslator {
103 constructor(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…