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

Method install

tools/common/_hyperscript.iife.js:9278–9290  ·  view source on GitHub ↗
(target, source, installArgs, runtime2)

Source from the content-addressed store, hash-verified

9276 this.behaviorArgs = args;
9277 }
9278 install(target, source, installArgs, runtime2) {
9279 var ctx = runtime2.makeContext(target, this, target, null);
9280 var behaviorArgs = this.behaviorArgs ? this.behaviorArgs.evaluate(ctx) : null;
9281 var behavior = runtime2.globalScope;
9282 for (var i = 0; i < this.behaviorNamespace.length; i++) {
9283 behavior = behavior[this.behaviorNamespace[i]];
9284 if (typeof behavior !== "object" && typeof behavior !== "function")
9285 throw new Error("No such behavior defined as " + this.behaviorPath);
9286 }
9287 if (!(behavior instanceof Function))
9288 throw new Error(this.behaviorPath + " is not a behavior");
9289 behavior(target, source, behaviorArgs);
9290 }
9291 static parse(parser) {
9292 if (!parser.matchToken("install")) return;
9293 var behaviorPath = parser.requireElement("dotOrColonPath").evalStatically();

Callers

nothing calls this directly

Calls 2

makeContextMethod · 0.45
evaluateMethod · 0.45

Tested by

no test coverage detected