MCPcopy Create free account
hub / github.com/angular/angular / appendNode

Method appendNode

packages/compiler/src/typecheck/ops/scope.ts:477–527  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

475 }
476
477 private appendNode(node: Node): void {
478 if (node instanceof Element) {
479 const opIndex = this.opQueue.push(new TcbElementOp(this.tcb, this, node)) - 1;
480 this.elementOpMap.set(node, opIndex);
481 if (this.tcb.env.config.controlFlowPreventingContentProjection !== 'suppress') {
482 this.appendContentProjectionCheckOp(node);
483 }
484 this.appendDirectivesAndInputsOfElementLikeNode(node);
485 this.appendOutputsOfElementLikeNode(node, node.inputs, node.outputs);
486 this.appendChildren(node);
487 this.checkAndAppendReferencesOfNode(node);
488 } else if (node instanceof Template) {
489 // Template children are rendered in a child scope.
490 this.appendDirectivesAndInputsOfElementLikeNode(node);
491 this.appendOutputsOfElementLikeNode(node, node.inputs, node.outputs);
492 const ctxIndex = this.opQueue.push(new TcbTemplateContextOp(this.tcb, this)) - 1;
493 this.templateCtxOpMap.set(node, ctxIndex);
494 if (this.tcb.env.config.checkTemplateBodies) {
495 this.opQueue.push(new TcbTemplateBodyOp(this.tcb, this, node));
496 } else if (this.tcb.env.config.alwaysCheckSchemaInTemplateBodies) {
497 this.appendDeepSchemaChecks(node.children);
498 }
499 this.checkAndAppendReferencesOfNode(node);
500 } else if (node instanceof DeferredBlock) {
501 this.appendDeferredBlock(node);
502 } else if (node instanceof IfBlock) {
503 this.opQueue.push(new TcbIfBlockOp(this.tcb, this, node));
504 } else if (node instanceof BoundaryBlock) {
505 this.opQueue.push(new TcbBoundaryOp(this.tcb, this, node));
506 } else if (node instanceof SwitchBlock) {
507 this.opQueue.push(new TcbSwitchOp(this.tcb, this, node));
508 } else if (node instanceof ForLoopBlock) {
509 this.opQueue.push(new TcbForOfOp(this.tcb, this, node));
510 node.empty && this.tcb.env.config.checkControlFlowBodies && this.appendChildren(node.empty);
511 } else if (node instanceof BoundText) {
512 this.opQueue.push(new TcbExpressionOp(this.tcb, this, node.value));
513 } else if (node instanceof Icu) {
514 this.appendIcuExpressions(node);
515 } else if (node instanceof Content) {
516 this.appendChildren(node);
517 } else if (node instanceof LetDeclaration) {
518 const opIndex = this.opQueue.push(new TcbLetDeclarationOp(this.tcb, this, node)) - 1;
519 if (this.isLocal(node)) {
520 this.tcb.oobRecorder.conflictingDeclaration(this.tcb.id, node);
521 } else {
522 this.letDeclOpMap.set(node.name, {opIndex, node});
523 }
524 } else if (node instanceof HostElement) {
525 this.appendHostElement(node);
526 }
527 }
528
529 private appendChildren(node: Node & {children: Node[]}) {
530 for (const child of node.children) {

Callers 2

forNodesMethod · 0.95
appendChildrenMethod · 0.95

Calls 13

appendChildrenMethod · 0.95
appendDeferredBlockMethod · 0.95
appendIcuExpressionsMethod · 0.95
isLocalMethod · 0.95
appendHostElementMethod · 0.95
setMethod · 0.65

Tested by

no test coverage detected