mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-24 11:43:18 -05:00
Store symbol table map key in CachedSymbolExportInfo (#45289)
* Store symbol table map key in CachedSymbolExportInfo * Remove debug assertion * Filter out known symbols (again) and private identifiers
This commit is contained in:
@@ -581,6 +581,7 @@ namespace ts {
|
||||
getEmitResolver,
|
||||
getExportsOfModule: getExportsOfModuleAsArray,
|
||||
getExportsAndPropertiesOfModule,
|
||||
forEachExportAndPropertyOfModule,
|
||||
getSymbolWalker: createGetSymbolWalker(
|
||||
getRestTypeOfSignature,
|
||||
getTypePredicateOfSignature,
|
||||
@@ -3532,6 +3533,24 @@ namespace ts {
|
||||
return exports;
|
||||
}
|
||||
|
||||
function forEachExportAndPropertyOfModule(moduleSymbol: Symbol, cb: (symbol: Symbol, key: __String) => void): void {
|
||||
const exports = getExportsOfModule(moduleSymbol);
|
||||
exports.forEach((symbol, key) => {
|
||||
if (!isReservedMemberName(key)) {
|
||||
cb(symbol, key);
|
||||
}
|
||||
});
|
||||
const exportEquals = resolveExternalModuleSymbol(moduleSymbol);
|
||||
if (exportEquals !== moduleSymbol) {
|
||||
const type = getTypeOfSymbol(exportEquals);
|
||||
if (shouldTreatPropertiesOfExternalModuleAsExports(type)) {
|
||||
getPropertiesOfType(type).forEach(symbol => {
|
||||
cb(symbol, symbol.escapedName);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function tryGetMemberInModuleExports(memberName: __String, moduleSymbol: Symbol): Symbol | undefined {
|
||||
const symbolTable = getExportsOfModule(moduleSymbol);
|
||||
if (symbolTable) {
|
||||
|
||||
@@ -4225,6 +4225,7 @@ namespace ts {
|
||||
getExportsOfModule(moduleSymbol: Symbol): Symbol[];
|
||||
/** Unlike `getExportsOfModule`, this includes properties of an `export =` value. */
|
||||
/* @internal */ getExportsAndPropertiesOfModule(moduleSymbol: Symbol): Symbol[];
|
||||
/* @internal */ forEachExportAndPropertyOfModule(moduleSymbol: Symbol, cb: (symbol: Symbol, key: __String) => void): void;
|
||||
getJsxIntrinsicTagNamesAt(location: Node): Symbol[];
|
||||
isOptionalParameter(node: ParameterDeclaration): boolean;
|
||||
getAmbientModules(): Symbol[];
|
||||
|
||||
@@ -3289,6 +3289,10 @@ namespace ts {
|
||||
return startsWith(symbol.escapedName as string, "__@");
|
||||
}
|
||||
|
||||
export function isPrivateIdentifierSymbol(symbol: Symbol): boolean {
|
||||
return startsWith(symbol.escapedName as string, "__#");
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes the word "Symbol" with unicode escapes
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user