(
node: Extract<Node, { type: "ExportNamedDeclaration" }>
)
| 439 | } |
| 440 | |
| 441 | private visitExport( |
| 442 | node: Extract<Node, { type: "ExportNamedDeclaration" }> |
| 443 | ): void { |
| 444 | if (node.exportKind === "type") return |
| 445 | // a namespace's export is a member of it, not of the module |
| 446 | if (this.scope !== this.root) return this.visit(node.declaration, node) |
| 447 | if (node.declaration) { |
| 448 | this.visit(node.declaration, node) |
| 449 | for (const id of declaredIds(node.declaration)) { |
| 450 | const binding = this.bindingsById.get(id) |
| 451 | if (binding) |
| 452 | this.exportsByName[binding.name] = { kind: "binding", binding } |
| 453 | } |
| 454 | return |
| 455 | } |
| 456 | for (const specifier of node.specifiers) { |
| 457 | specifier.parent = node |
| 458 | if (specifier.exportKind === "type") continue |
| 459 | const name = exportNameOf(specifier.exported) |
| 460 | if (node.source) { |
| 461 | this.exportsByName[name] = { |
| 462 | kind: "reexport", |
| 463 | specifier: node.source.value, |
| 464 | name: exportNameOf(specifier.local) |
| 465 | } |
| 466 | } else { |
| 467 | const reference = this.reference( |
| 468 | specifier.local as IdentifierReference, |
| 469 | false |
| 470 | ) |
| 471 | specifier.local.parent = specifier |
| 472 | this.pendingExports.push([name, reference]) |
| 473 | } |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | private visitTarget(target: Node, parent: Node): void { |
| 478 | target.parent = parent |
no test coverage detected