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

Method set

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

Source from the content-addressed store, hash-verified

4194 return { root: this.root };
4195 }
4196 set(ctx, lhs, value) {
4197 ctx.meta.runtime.nullCheck(lhs.root, this.root);
4198 if (this._isAttribute) {
4199 ctx.meta.runtime.implicitLoop(lhs.root, (elt) => {
4200 value == null ? elt.removeAttribute(this._prop) : elt.setAttribute(this._prop, value);
4201 });
4202 } else if (this._isStyle) {
4203 ctx.meta.runtime.implicitLoop(lhs.root, (elt) => {
4204 elt.style[this._prop] = value;
4205 });
4206 } else {
4207 var runtime2 = ctx.meta.runtime;
4208 runtime2.implicitLoop(lhs.root, (elt) => {
4209 runtime2.setProperty(elt, this._prop, value);
4210 });
4211 }
4212 }
4213 delete(ctx, lhs) {
4214 ctx.meta.runtime.nullCheck(lhs.root, this.root);
4215 var runtime2 = ctx.meta.runtime;

Callers

nothing calls this directly

Calls 3

nullCheckMethod · 0.45
implicitLoopMethod · 0.45
setPropertyMethod · 0.45

Tested by

no test coverage detected