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

Method set

tools/common/_hyperscript.iife.js:3971–3991  ·  view source on GitHub ↗
(ctx, lhs, value)

Source from the content-addressed store, hash-verified

3969 return { root: this.root };
3970 }
3971 set(ctx, lhs, value) {
3972 ctx.meta.runtime.nullCheck(lhs.root, this.root);
3973 if (this.attribute) {
3974 var name = this.attribute.name;
3975 if (this.attribute.type === "styleRef") {
3976 ctx.meta.runtime.implicitLoop(lhs.root, (elt) => {
3977 elt.style[name] = value;
3978 });
3979 } else {
3980 ctx.meta.runtime.implicitLoop(lhs.root, (elt) => {
3981 value == null ? elt.removeAttribute(name) : elt.setAttribute(name, value);
3982 });
3983 }
3984 } else {
3985 var runtime2 = ctx.meta.runtime;
3986 var prop = this.prop.value;
3987 runtime2.implicitLoop(lhs.root, (elt) => {
3988 runtime2.setProperty(elt, prop, value);
3989 });
3990 }
3991 }
3992 };
3993 var InExpression = class _InExpression extends Expression {
3994 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