| 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 |