(candidate: SiteCandidate, module: SourceModule)
| 6819 | } |
| 6820 | |
| 6821 | private finalize(candidate: SiteCandidate, module: SourceModule): Site { |
| 6822 | const { state } = candidate |
| 6823 | const site = this.siteOf(candidate, module) |
| 6824 | if (this.mode === "standalone" && isInIsland(state.node, module)) { |
| 6825 | site.status = "island" |
| 6826 | return site |
| 6827 | } |
| 6828 | const dynamic = |
| 6829 | this.receiveValue(site, state, module) ?? this.writtenElsewhereIn(state) |
| 6830 | if (dynamic) return refuseDynamic(site, dynamic) |
| 6831 | const runsFirst = runsBeforeBody(state.node, module) |
| 6832 | const unreadable = this.receiveReads(site, candidate, module, runsFirst) |
| 6833 | if (unreadable) return refuseDynamic(site, unreadable) |
| 6834 | this.receiveHelpers(site, state, module, runsFirst) |
| 6835 | for (const [binding, declaring, reader] of state.trace.readFirst) { |
| 6836 | if (declaring === module) continue |
| 6837 | const unchecked = this.receiveReadFirst(site, binding, declaring, reader) |
| 6838 | if (unchecked) { |
| 6839 | return refuseDynamic( |
| 6840 | site, |
| 6841 | new DynamicValue(module, state.node, unchecked) |
| 6842 | ) |
| 6843 | } |
| 6844 | } |
| 6845 | this.collectReferences(site, state, module, runsFirst) |
| 6846 | return site |
| 6847 | } |
| 6848 | |
| 6849 | // what the site evaluated to, or why the build refuses it |
| 6850 | private receiveValue( |
no test coverage detected