MCPcopy Index your code
hub / github.com/nodejs/node / extendExportSymbols

Function extendExportSymbols

test/fixtures/snapshot/typescript.js:51478–51503  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 1

visitFunction · 0.85

Calls 5

resolveSymbolFunction · 0.85
forEachMethod · 0.65
getMethod · 0.65
setMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…