mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 05:17:43 -05:00
Make getLocalSymbolForExportDefault look harder for an export
Look for a symbol that has a `.localSymbol` property instead of blindly using the first one. Fixes #37829.
This commit is contained in:
@@ -4769,7 +4769,11 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function getLocalSymbolForExportDefault(symbol: Symbol) {
|
||||
return isExportDefaultSymbol(symbol) ? symbol.declarations[0].localSymbol : undefined;
|
||||
if (!isExportDefaultSymbol(symbol)) return undefined;
|
||||
for (const decl of symbol.declarations) {
|
||||
if (decl.localSymbol) return decl.localSymbol;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function isExportDefaultSymbol(symbol: Symbol): boolean {
|
||||
|
||||
Reference in New Issue
Block a user