MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / insertAborts

Function insertAborts

tools/common/_hyperscript.iife.js:8512–8534  ·  view source on GitHub ↗
(cmd, inLoop, visited)

Source from the content-addressed store, hash-verified

8510 var ESCAPE_TYPES = /* @__PURE__ */ new Set(["returnCommand", "exitCommand", "haltCommand", "breakCommand", "continueCommand"]);
8511 var LOOP_TYPES = /* @__PURE__ */ new Set(["breakCommand", "continueCommand"]);
8512 function insertAborts(cmd, inLoop, visited) {
8513 if (!visited) visited = /* @__PURE__ */ new Set();
8514 if (!cmd || visited.has(cmd)) return;
8515 visited.add(cmd);
8516 var childInLoop = inLoop || cmd.loop !== void 0;
8517 for (var key of Object.keys(cmd)) {
8518 if (key === "parent") continue;
8519 var val = cmd[key];
8520 if (val instanceof ParseElement && ESCAPE_TYPES.has(val.type)) {
8521 if (!LOOP_TYPES.has(val.type) || !inLoop) {
8522 var abort = new AbortViewTransition();
8523 abort.next = val;
8524 cmd[key] = abort;
8525 visited.add(abort);
8526 }
8527 }
8528 for (var item of [val].flat()) {
8529 if (item instanceof ParseElement) {
8530 insertAborts(item, childInLoop, visited);
8531 }
8532 }
8533 }
8534 }
8535 var ViewTransitionTick = class extends Command {
8536 constructor() {
8537 super();

Callers 1

parseMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected