MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / alloc

Function alloc

host/dom/src/main/state.js:16–24  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

14 const files = [];
15
16 const alloc = (n) => {
17 if (n === null || n === undefined) return HANDLE_NONE;
18 nodes.push(n);
19 const h = nodes.length - 1;
20 let set = handleByEl.get(n);
21 if (!set) { set = new Set(); handleByEl.set(n, set); }
22 set.add(h);
23 return h;
24 };
25
26 const node = (h) => {
27 if (h < 0 || h >= nodes.length || nodes[h] === null) {

Callers 3

allocListFunction · 0.85
platform.jsFile · 0.85
tree.jsFile · 0.85

Calls 4

pushMethod · 0.80
setMethod · 0.80
addMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected