( unit: ViewCompilationUnit, suffix: string, i18nMeta: i18n.I18nMeta | undefined, children?: t.Node[], sourceSpan?: ParseSourceSpan, )
| 621 | } |
| 622 | |
| 623 | function ingestDeferView( |
| 624 | unit: ViewCompilationUnit, |
| 625 | suffix: string, |
| 626 | i18nMeta: i18n.I18nMeta | undefined, |
| 627 | children?: t.Node[], |
| 628 | sourceSpan?: ParseSourceSpan, |
| 629 | ): ir.TemplateOp | null { |
| 630 | if (i18nMeta !== undefined && !(i18nMeta instanceof i18n.BlockPlaceholder)) { |
| 631 | throw Error('Unhandled i18n metadata type for defer block'); |
| 632 | } |
| 633 | if (children === undefined) { |
| 634 | return null; |
| 635 | } |
| 636 | const secondaryView = unit.job.allocateView(unit.xref); |
| 637 | ingestNodes(secondaryView, children); |
| 638 | const templateOp = ir.createTemplateOp( |
| 639 | secondaryView.xref, |
| 640 | ir.TemplateKind.Block, |
| 641 | null, |
| 642 | `Defer${suffix}`, |
| 643 | ir.Namespace.HTML, |
| 644 | i18nMeta, |
| 645 | sourceSpan!, |
| 646 | sourceSpan!, |
| 647 | ); |
| 648 | unit.create.push(templateOp); |
| 649 | return templateOp; |
| 650 | } |
| 651 | |
| 652 | function ingestDeferBlock(unit: ViewCompilationUnit, deferBlock: t.DeferredBlock): void { |
| 653 | let ownResolverFn: o.Expression | null = null; |
no test coverage detected