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

Method execute

packages/compiler/src/typecheck/ops/host.ts:31–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 }
30
31 override execute(): TcbExpr {
32 const id = this.tcb.allocateId();
33 let tagNames: string;
34
35 if (this.element.tagNames.length === 1) {
36 tagNames = `"${this.element.tagNames[0]}"`;
37 } else {
38 tagNames = `null! as ${this.element.tagNames.map((t) => `"${t}"`).join(' | ')}`;
39 }
40
41 const initializer = new TcbExpr(`document.createElement(${tagNames})`);
42 initializer.addParseSpanInfo(this.element.sourceSpan);
43 this.scope.addStatement(new TcbExpr(`var ${id} = ${initializer.print()}`));
44 return new TcbExpr(id);
45 }
46}

Callers

nothing calls this directly

Calls 6

addParseSpanInfoMethod · 0.95
printMethod · 0.95
allocateIdMethod · 0.80
mapMethod · 0.80
addStatementMethod · 0.80
joinMethod · 0.65

Tested by

no test coverage detected