* Extends one symbol table with another while collecting information on name collisions for error message generation into the `lookupTable` argument * Not passing `lookupTable` and `exportNode` disables this collection, and just extends the tables
(target, source, lookupTable, exportNode)
| 51476 | * Not passing `lookupTable` and `exportNode` disables this collection, and just extends the tables |
| 51477 | */ |
| 51478 | function extendExportSymbols(target, source, lookupTable, exportNode) { |
| 51479 | if (!source) |
| 51480 | return; |
| 51481 | source.forEach(function (sourceSymbol, id) { |
| 51482 | if (id === "default" /* InternalSymbolName.Default */) |
| 51483 | return; |
| 51484 | var targetSymbol = target.get(id); |
| 51485 | if (!targetSymbol) { |
| 51486 | target.set(id, sourceSymbol); |
| 51487 | if (lookupTable && exportNode) { |
| 51488 | lookupTable.set(id, { |
| 51489 | specifierText: ts.getTextOfNode(exportNode.moduleSpecifier) |
| 51490 | }); |
| 51491 | } |
| 51492 | } |
| 51493 | else if (lookupTable && exportNode && targetSymbol && resolveSymbol(targetSymbol) !== resolveSymbol(sourceSymbol)) { |
| 51494 | var collisionTracker = lookupTable.get(id); |
| 51495 | if (!collisionTracker.exportsWithDuplicate) { |
| 51496 | collisionTracker.exportsWithDuplicate = [exportNode]; |
| 51497 | } |
| 51498 | else { |
| 51499 | collisionTracker.exportsWithDuplicate.push(exportNode); |
| 51500 | } |
| 51501 | } |
| 51502 | }); |
| 51503 | } |
| 51504 | function getExportsOfModuleWorker(moduleSymbol) { |
| 51505 | var visitedSymbols = []; |
| 51506 | // A module defined by an 'export=' consists of one export that needs to be resolved |