mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Check for undefined globalObjectType in getPropertyOfObjectType
This can happen during symbol merging when initialising the checker, because global types aren't set until after symbols are merged. May stop the crashes in #47179, #47181, #47180. Does not address the underlying problem of needing to resolve aliases, and therefore names, during symbol merging when initialising the checker.
This commit is contained in:
@@ -12360,7 +12360,7 @@ namespace ts {
|
||||
return symbol;
|
||||
}
|
||||
}
|
||||
return getPropertyOfObjectType(globalObjectType, name);
|
||||
return globalObjectType === undefined ? undefined : getPropertyOfObjectType(globalObjectType, name);
|
||||
}
|
||||
if (type.flags & TypeFlags.UnionOrIntersection) {
|
||||
return getPropertyOfUnionOrIntersectionType(type as UnionOrIntersectionType, name, skipObjectFunctionPropertyAugment);
|
||||
|
||||
Reference in New Issue
Block a user