Function
declareVariable
(identifier: TcbExpr, type: TcbExpr)
Source from the content-addressed store, hash-verified
| 119 | * @param type Type that the variable should be initialized to. |
| 120 | */ |
| 121 | export 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. |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…