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

Function insertAborts

www/js/_hyperscript-max.js:8961–8983  ·  view source on GitHub ↗
(cmd, inLoop, visited)

Source from the content-addressed store, hash-verified

8959 var ESCAPE_TYPES = /* @__PURE__ */ new Set(["returnCommand", "exitCommand", "haltCommand", "breakCommand", "continueCommand"]);
8960 var LOOP_TYPES = /* @__PURE__ */ new Set(["breakCommand", "continueCommand"]);
8961 function insertAborts(cmd, inLoop, visited) {
8962 if (!visited) visited = /* @__PURE__ */ new Set();
8963 if (!cmd || visited.has(cmd)) return;
8964 visited.add(cmd);
8965 var childInLoop = inLoop || cmd.loop !== void 0;
8966 for (var key of Object.keys(cmd)) {
8967 if (key === "parent") continue;
8968 var val = cmd[key];
8969 if (val instanceof ParseElement && ESCAPE_TYPES.has(val.type)) {
8970 if (!LOOP_TYPES.has(val.type) || !inLoop) {
8971 var abort = new AbortViewTransition();
8972 abort.next = val;
8973 cmd[key] = abort;
8974 visited.add(abort);
8975 }
8976 }
8977 for (var item of [val].flat()) {
8978 if (item instanceof ParseElement) {
8979 insertAborts(item, childInLoop, visited);
8980 }
8981 }
8982 }
8983 }
8984 var ViewTransitionTick = class extends Command {
8985 constructor() {
8986 super();

Callers 1

parseMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected