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

Function execute

packages/compiler/src/typecheck/ops/directive_type.ts:41–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 }
40
41 override execute(): TcbExpr {
42 const rawType = this.tcb.env.referenceTcbValue(this.dir.ref);
43
44 let type: TcbExpr;
45 let span: ParseSourceSpan;
46 if (
47 this.dir.isGeneric === false ||
48 this.dir.typeParameters === null ||
49 this.dir.typeParameters.length === 0
50 ) {
51 type = rawType;
52 } else {
53 const typeArguments = Array(this.dir.typeParameters?.length ?? 0)
54 .fill('any')
55 .join(', ');
56 type = new TcbExpr(`${rawType.print()}<${typeArguments}>`);
57 }
58
59 if (this.node instanceof HostElement) {
60 span = this.node.sourceSpan;
61 } else {
62 span = this.node.startSourceSpan || this.node.sourceSpan;
63 }
64
65 const identifier =
66 this.dir.matchSource === MatchSource.HostDirective
67 ? ExpressionIdentifier.HOST_DIRECTIVE
68 : ExpressionIdentifier.DIRECTIVE;
69 const id = new TcbExpr(this.tcb.allocateId())
70 .addExpressionIdentifier(identifier, this.directiveIndex)
71 .addParseSpanInfo(span);
72 this.scope.addStatement(declareVariable(id, type));
73 return id;
74 }
75}
76
77/**

Callers

nothing calls this directly

Calls 8

declareVariableFunction · 0.90
addParseSpanInfoMethod · 0.80
allocateIdMethod · 0.80
addStatementMethod · 0.80
referenceTcbValueMethod · 0.65
joinMethod · 0.65
printMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…