Fix crash when looking for __esModule during symbol table merging (#52554)

This commit is contained in:
Andrew Branch
2023-02-02 09:27:10 -08:00
committed by GitHub
parent 30993855fd
commit 4ec9b2f8d7
5 changed files with 120 additions and 1 deletions

View File

@@ -3884,7 +3884,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
function resolveExportByName(moduleSymbol: Symbol, name: __String, sourceNode: TypeOnlyCompatibleAliasDeclaration | undefined, dontResolveAlias: boolean) {
const exportValue = moduleSymbol.exports!.get(InternalSymbolName.ExportEquals);
const exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name) : moduleSymbol.exports!.get(name);
const exportSymbol = exportValue
? getPropertyOfType(getTypeOfSymbol(exportValue), name, /*skipObjectFunctionPropertyAugment*/ true)
: moduleSymbol.exports!.get(name);
const resolved = resolveSymbol(exportSymbol, dontResolveAlias);
markSymbolOfAliasDeclarationIfTypeOnly(sourceNode, exportSymbol, resolved, /*overwriteEmpty*/ false);
return resolved;