mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-01 14:25:16 -05:00
Fixed expando functions with symbol-only properties (#54726)
This commit is contained in:
committed by
GitHub
parent
2623fe7049
commit
5128e06a9d
@@ -13072,19 +13072,16 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
return;
|
||||
}
|
||||
// Combinations of function, class, enum and module
|
||||
let members = emptySymbols;
|
||||
let members = getExportsOfSymbol(symbol);
|
||||
let indexInfos: IndexInfo[] | undefined;
|
||||
if (symbol.exports) {
|
||||
members = getExportsOfSymbol(symbol);
|
||||
if (symbol === globalThisSymbol) {
|
||||
const varsOnly = new Map<__String, Symbol>();
|
||||
members.forEach(p => {
|
||||
if (!(p.flags & SymbolFlags.BlockScoped) && !(p.flags & SymbolFlags.ValueModule && p.declarations?.length && every(p.declarations, isAmbientModule))) {
|
||||
varsOnly.set(p.escapedName, p);
|
||||
}
|
||||
});
|
||||
members = varsOnly;
|
||||
}
|
||||
if (symbol === globalThisSymbol) {
|
||||
const varsOnly = new Map<__String, Symbol>();
|
||||
members.forEach(p => {
|
||||
if (!(p.flags & SymbolFlags.BlockScoped) && !(p.flags & SymbolFlags.ValueModule && p.declarations?.length && every(p.declarations, isAmbientModule))) {
|
||||
varsOnly.set(p.escapedName, p);
|
||||
}
|
||||
});
|
||||
members = varsOnly;
|
||||
}
|
||||
let baseConstructorIndexInfo: IndexInfo | undefined;
|
||||
setStructuredTypeMembers(type, members, emptyArray, emptyArray, emptyArray);
|
||||
|
||||
Reference in New Issue
Block a user