Do not add reexported names to the exportSpecifiers list of moduleinfo (#39213)

This commit is contained in:
Wesley Wigham
2020-06-23 17:56:44 -07:00
committed by GitHub
parent 5d9b7855c7
commit 7893c9fc7e
5 changed files with 92 additions and 3 deletions

View File

@@ -8,9 +8,9 @@ namespace ts {
export interface ExternalModuleInfo {
externalImports: (ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration)[]; // imports of other external modules
externalHelpersImportDeclaration: ImportDeclaration | undefined; // import of external helpers
exportSpecifiers: Map<ExportSpecifier[]>; // export specifiers by name
exportSpecifiers: Map<ExportSpecifier[]>; // file-local export specifiers by name (no reexports)
exportedBindings: Identifier[][]; // exported names of local declarations
exportedNames: Identifier[] | undefined; // all exported names local to module
exportedNames: Identifier[] | undefined; // all exported names in the module, both local and reexported
exportEquals: ExportAssignment | undefined; // an export= declaration if one was present
hasExportStarsToExportValues: boolean; // whether this module contains export*
}
@@ -201,7 +201,9 @@ namespace ts {
for (const specifier of cast(node.exportClause, isNamedExports).elements) {
if (!uniqueExports.get(idText(specifier.name))) {
const name = specifier.propertyName || specifier.name;
exportSpecifiers.add(idText(name), specifier);
if (!node.moduleSpecifier) {
exportSpecifiers.add(idText(name), specifier);
}
const decl = resolver.getReferencedImportDeclaration(name)
|| resolver.getReferencedValueDeclaration(name);