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

Method delete

www/js/_hyperscript.js:4524–4539  ·  view source on GitHub ↗
(ctx, lhs)

Source from the content-addressed store, hash-verified

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