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

Method set

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

Source from the content-addressed store, hash-verified

4274 return { root: this.root };
4275 }
4276 set(ctx, lhs, value) {
4277 ctx.meta.runtime.nullCheck(lhs.root, this.root);
4278 if (this.attribute) {
4279 var name = this.attribute.name;
4280 if (this.attribute.type === "styleRef") {
4281 ctx.meta.runtime.implicitLoop(lhs.root, (elt) => {
4282 elt.style[name] = value;
4283 });
4284 } else {
4285 ctx.meta.runtime.implicitLoop(lhs.root, (elt) => {
4286 value == null ? elt.removeAttribute(name) : elt.setAttribute(name, value);
4287 });
4288 }
4289 } else {
4290 var runtime2 = ctx.meta.runtime;
4291 var prop = this.prop.value;
4292 runtime2.implicitLoop(lhs.root, (elt) => {
4293 runtime2.setProperty(elt, prop, value);
4294 });
4295 }
4296 }
4297 };
4298 var InExpression = class _InExpression extends Expression {
4299 static grammarName = "inExpression";

Callers

nothing calls this directly

Calls 3

nullCheckMethod · 0.45
implicitLoopMethod · 0.45
setPropertyMethod · 0.45

Tested by

no test coverage detected