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

Method assignToNamespace

src/core/runtime/runtime.js:522–539  ·  view source on GitHub ↗
(elt, nameSpace, name, value)

Source from the content-addressed store, hash-verified

520 }
521
522 assignToNamespace(elt, nameSpace, name, value) {
523 let root
524 if (elt == null || (typeof document !== "undefined" && elt === document.body)) {
525 root = this.#globalScope;
526 } else {
527 root = this.getHyperscriptFeatures(elt);
528 }
529 var propertyName;
530 while ((propertyName = nameSpace.shift()) !== undefined) {
531 var newRoot = root[propertyName];
532 if (newRoot == null) {
533 newRoot = {};
534 root[propertyName] = newRoot;
535 }
536 root = newRoot;
537 }
538 root[name] = value;
539 }
540
541 // =================================================================
542 // Collection and iteration utilities

Callers 8

installFunction · 0.45
installFunction · 0.45
installFunction · 0.45
installMethod · 0.45
installMethod · 0.45
installMethod · 0.45
installMethod · 0.45
installMethod · 0.45

Calls 1

Tested by

no test coverage detected