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

Method delete

www/js/_hyperscript-max.js:4523–4538  ·  view source on GitHub ↗
(ctx, lhs)

Source from the content-addressed store, hash-verified

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

Callers 7

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

Calls 2

nullCheckMethod · 0.45
notifyMutationMethod · 0.45

Tested by

no test coverage detected