(facts: Facts, $: InternalScope, resolve: () => BaseRoot)
| 1422 | // equal definitions' one Type, as their nodes would make it. A kind and comma |
| 1423 | // start each node's key, and nothing a definition is scanned to does |
| 1424 | const defer = (facts: Facts, $: InternalScope, resolve: () => BaseRoot) => { |
| 1425 | const existing = $.nodesByKey.get(facts.key) |
| 1426 | if (existing && (!deferred.has(existing) || Object.isExtensible(existing))) |
| 1427 | return existing as never |
| 1428 | const { fn, c } = deferredCallable() |
| 1429 | const self = fn as BaseRoot |
| 1430 | Object.setPrototypeOf(self, shellProto) |
| 1431 | deferred.set(self, { facts, fn, c, $, resolve }) |
| 1432 | $.nodesByKey.set(facts.key, self) |
| 1433 | // fixes the global config, as parsing a definition would |
| 1434 | if (!$ark.cfg) { |
| 1435 | void $.cfg |
| 1436 | recordFirstType(self, true) |
| 1437 | } |
| 1438 | return self as never |
| 1439 | } |
| 1440 | |
| 1441 | // no scope but ark says what the scanned keywords are |
| 1442 | const canDefer = ($: InternalScope) => { |
no test coverage detected