mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00: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:
1 parent
b601487905
commit
a320e1b554
5 files changed
+39
-1
No files matched your search
@@ -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