marko
Version:
Optimized runtime for Marko templates.
26 lines (25 loc) • 932 B
JavaScript
let require_control_flow = require("../dom-CI-06TZb.js"), handlePendingTry = (fn, scope, branch) => {
for (; branch;) {
if (branch.O?.i) return (branch.J ||= []).push(fn, scope);
branch = branch.N;
}
};
//#region src/dom/catch.feat.ts
require_control_flow.Yt((runEffects) => (effects, checkPending = require_control_flow.Xt.has(effects)) => {
if (checkPending || require_control_flow.Jt.has(effects)) {
let i = 0, fn, scope, branch;
for (; i < effects.length;) fn = effects[i++], scope = effects[i++], (branch = scope.F)?.H !== 0 && !(checkPending && handlePendingTry(fn, scope, branch)) && fn(scope);
} else runEffects(effects);
}, (runRender) => (render) => {
try {
let branch = render.b.F;
for (; branch;) {
if (branch.W) return render.f = 1, branch.W.push(render);
branch = branch.N;
}
render.f = 0, runRender(render);
} catch (error) {
require_control_flow.h(render.b, error);
}
});
//#endregion