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

Function declareVariable

packages/compiler/src/typecheck/ops/codegen.ts:121–124  ·  view source on GitHub ↗
(identifier: TcbExpr, type: TcbExpr)

Source from the content-addressed store, hash-verified

119 * @param type Type that the variable should be initialized to.
120 */
121export function declareVariable(identifier: TcbExpr, type: TcbExpr): TcbExpr {
122 type.addExpressionIdentifier(ExpressionIdentifier.VARIABLE_AS_EXPRESSION);
123 return new TcbExpr(`var ${identifier.print()} = null! as ${type.print()}`);
124}
125
126/**
127 * Formats an array of `TcbExpr` as a block of single statements.

Callers 6

executeMethod · 0.90
executeMethod · 0.90
executeMethod · 0.90
executeFunction · 0.90
executeMethod · 0.90
executeMethod · 0.90

Calls 2

printMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…