marko
Version:
Optimized runtime for Marko templates.
14 lines (13 loc) • 1.16 kB
JavaScript
;
const require_control_flow = require("../dom-CNgQ6lj9.js");
//#region src/dom/dynamic-tag-var.feat.ts
require_control_flow.installBranchRenders();
require_control_flow.installDynamicTagVar((scope, branch, scopeKey, renderer) => {
branch[require_control_flow.BranchRenders] = require_control_flow.createBranchRenders(scope, scopeKey);
if (typeof renderer === "string") branch[require_control_flow.TagVariable](() => require_control_flow._el_read(branch[require_control_flow.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