| 5514 | const result: HeldExport[] = [] |
| 5515 | const visited = new Set<Follow>() |
| 5516 | const visit = (binding: Binding, module: SourceModule, held: Held) => { |
| 5517 | const follow = this.followOf(binding, module, held) |
| 5518 | if (visited.has(follow)) return |
| 5519 | visited.add(follow) |
| 5520 | for (const name of binding.exportNames) result.push([module, name, held]) |
| 5521 | for (const holding of follow.holdings) { |
| 5522 | if ("binding" in holding) |
| 5523 | visit(holding.binding, holding.module, holding.held) |
| 5524 | else result.push([holding.module, holding.name, holding.held]) |
| 5525 | } |
| 5526 | } |
| 5527 | visit(binding, module, held) |
| 5528 | return result |
| 5529 | } |