( module: InternalModule, $: BaseScope )
| 1257 | } |
| 1258 | |
| 1259 | const bindModuleLazily = ( |
| 1260 | module: InternalModule, |
| 1261 | $: BaseScope |
| 1262 | ): InternalModule => { |
| 1263 | const bound = new RootModule({}) |
| 1264 | const resolve = (k: string) => { |
| 1265 | const resolution = module[k] |
| 1266 | return hasArkKind(resolution, "module") ? |
| 1267 | bindModuleLazily(resolution, $) |
| 1268 | : finalizeExport($, $.bindRef(resolution as BaseRoot | GenericRoot)) |
| 1269 | } |
| 1270 | for (const k in module) defineLazily(bound, k, resolve, isFinalResolution) |
| 1271 | return bound as never |
| 1272 | } |
| 1273 | |
| 1274 | /** |
| 1275 | * whether a module's member can hold `resolution`: an alias referencing a |
no test coverage detected