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

Method delete

www/js/_hyperscript.esm.js:4522–4537  ·  view source on GitHub ↗
(ctx, lhs)

Source from the content-addressed store, hash-verified

4520 lhs.root[lhs.index] = value;
4521 }
4522 delete(ctx, lhs) {
4523 if (this.andBefore || this.andAfter) {
4524 throw new Error("Cannot remove a slice - use a single index");
4525 }
4526 ctx.meta.runtime.nullCheck(lhs.root, this.root);
4527 var runtime2 = ctx.meta.runtime;
4528 var root = lhs.root;
4529 var idx = lhs.index;
4530 if (Array.isArray(root)) {
4531 if (idx < 0) idx = root.length + idx;
4532 root.splice(idx, 1);
4533 } else {
4534 delete root[idx];
4535 }
4536 runtime2.notifyMutation(root);
4537 }
4538};
4539var MathOperator = class _MathOperator extends Expression {
4540 static grammarName = "mathOperator";

Callers 6

stopMethod · 0.45
_unsubscribeEffectMethod · 0.45
_cleanupOrphanedDepsMethod · 0.45
_morphChildrenFunction · 0.45
_createPersistentIdsFunction · 0.45
resolveMethod · 0.45

Calls 2

nullCheckMethod · 0.45
notifyMutationMethod · 0.45

Tested by

no test coverage detected