( template: string, typeName: string, sourceMapUrl: string, preserveWhitespaces: boolean, deferBlockDependencies: (() => Promise<unknown> | null)[] | undefined, )
| 785 | } |
| 786 | |
| 787 | function parseJitTemplate( |
| 788 | template: string, |
| 789 | typeName: string, |
| 790 | sourceMapUrl: string, |
| 791 | preserveWhitespaces: boolean, |
| 792 | deferBlockDependencies: (() => Promise<unknown> | null)[] | undefined, |
| 793 | ) { |
| 794 | // Parse the template and check for errors. |
| 795 | const parsed = parseTemplate(template, sourceMapUrl, {preserveWhitespaces}); |
| 796 | if (parsed.errors !== null) { |
| 797 | const errors = parsed.errors.map((err) => err.toString()).join(', '); |
| 798 | throw new Error(`Errors during JIT compilation of template for ${typeName}: ${errors}`); |
| 799 | } |
| 800 | const binder = new R3TargetBinder(null); |
| 801 | const boundTarget = binder.bind({template: parsed.nodes}); |
| 802 | |
| 803 | return { |
| 804 | template: parsed, |
| 805 | defer: createR3ComponentDeferMetadata(boundTarget, deferBlockDependencies), |
| 806 | }; |
| 807 | } |
| 808 | |
| 809 | /** |
| 810 | * Convert the expression, if present to an `R3ProviderExpression`. |
no test coverage detected
searching dependent graphs…