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

Class TcbBlockVariableOp

packages/compiler/src/typecheck/ops/variables.ts:90–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 * Executing this operation returns the identifier which can be used to refer to the variable.
89 */
90export class TcbBlockVariableOp extends TcbOp {
91 constructor(
92 private tcb: Context,
93 private scope: Scope,
94 private initializer: TcbExpr,
95 private variable: Variable,
96 ) {
97 super();
98 }
99
100 override get optional() {
101 return false;
102 }
103
104 override execute(): TcbExpr {
105 const id = new TcbExpr(this.tcb.allocateId());
106 id.addParseSpanInfo(this.variable.keySpan);
107 this.initializer.wrapForTypeChecker();
108 const variable = new TcbExpr(`var ${id.print()} = ${this.initializer.print()}`);
109 variable.addParseSpanInfo(this.variable.sourceSpan);
110 this.scope.addStatement(variable);
111 return id;
112 }
113}

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…