MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / set

Method set

www/js/_hyperscript.js:4197–4213  ·  view source on GitHub ↗
(ctx, lhs, value)

Source from the content-addressed store, hash-verified

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