Skip to content

Commit a9e4980

Browse files
committed
Lookup in both cache if not skipObjectFunctionPropertyAugment
1 parent a252ef9 commit a9e4980

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/compiler/checker.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10997,15 +10997,15 @@ namespace ts {
1099710997
// these partial properties when identifying discriminant properties, but otherwise they are filtered out
1099810998
// and do not appear to be present in the union type.
1099910999
function getUnionOrIntersectionProperty(type: UnionOrIntersectionType, name: __String, skipObjectFunctionPropertyAugment?: boolean): Symbol | undefined {
11000-
const properties = skipObjectFunctionPropertyAugment ?
11001-
type.propertyCacheWithoutObjectFunctionPropertyAugment ||= createSymbolTable() :
11002-
type.propertyCache ||= createSymbolTable();
11003-
let property = properties.get(name);
11004-
if (!property) {
11005-
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
11006-
if (property) {
11007-
properties.set(name, property);
11008-
}
11000+
let property = type.propertyCacheWithoutObjectFunctionPropertyAugment?.get(name) ||
11001+
!skipObjectFunctionPropertyAugment ? type.propertyCache?.get(name) : undefined;
11002+
if (property) return property;
11003+
property = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
11004+
if (property) {
11005+
const properties = skipObjectFunctionPropertyAugment ?
11006+
type.propertyCacheWithoutObjectFunctionPropertyAugment ||= createSymbolTable() :
11007+
type.propertyCache ||= createSymbolTable();
11008+
properties.set(name, property);
1100911009
}
1101011010
return property;
1101111011
}

0 commit comments

Comments
 (0)