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