UNPKG

marko

Version:

Optimized runtime for Marko templates.

13 lines (12 loc) • 1.13 kB
import { Ft as _el_read, In as BranchRenders, Jn as TagVariable, cn as installBranchRenders, g as installDynamicTagVar, qn as StartNode, sn as createBranchRenders } from "../dom-o9jQjchF.mjs"; //#region src/dom/dynamic-tag-var.feat.ts installBranchRenders(); installDynamicTagVar((scope, branch, scopeKey, renderer) => { branch[BranchRenders] = createBranchRenders(scope, scopeKey); if (typeof renderer === "string") branch[TagVariable](() => _el_read(branch[StartNode])); else { if (renderer["lazy"]) throw new Error(`A dynamic tag with a [tag variable](https://markojs.com/docs/reference/language#tag-variables) rendered \`${renderer["id"]}\`, which is lazily loaded, so it does not support one. Import it without \`load\`, or remove the variable.`); if (!(renderer["setup"] || renderer["params"])?.["returns"]) throw new Error(`A dynamic tag with a [tag variable](https://markojs.com/docs/reference/language#tag-variables) rendered \`${renderer["id"]}\`, which does not [\`<return>\`](https://markojs.com/docs/reference/core-tag#return) a value. Add a \`<return>\` to it, or remove the variable.`); } }); //#endregion