(name, value)
| 22432 | } |
| 22433 | |
| 22434 | register(name, value) { |
| 22435 | if (!this._registry.has(name)) { |
| 22436 | value = value || new (this._registry.get('builtins').module)(name); |
| 22437 | this._registry.set(name, value); |
| 22438 | let current = name; |
| 22439 | for (;;) { |
| 22440 | const index = current.lastIndexOf('.'); |
| 22441 | if (index === -1) { |
| 22442 | break; |
| 22443 | } |
| 22444 | const child = current.substring(index + 1); |
| 22445 | current = current.substring(0, index); |
| 22446 | if (!value.__module__) { |
| 22447 | value.__module__ = current; |
| 22448 | } |
| 22449 | const parent = this.register(current); |
| 22450 | parent[child] = value; |
| 22451 | value = parent; |
| 22452 | } |
| 22453 | } |
| 22454 | return this._registry.get(name); |
| 22455 | } |
| 22456 | |
| 22457 | registerFunction(name, value) { |
| 22458 | const builtins = this.builtins; |
no test coverage detected