@@ -539,7 +539,7 @@ namespace ts {
539
539
}
540
540
541
541
function getObjectFlags(type: Type): ObjectFlags {
542
- return type.flags & TypeFlags.ObjectType ? (<ObjectType>type).objectFlags : 0;
542
+ return type.flags & TypeFlags.Object ? (<ObjectType>type).objectFlags : 0;
543
543
}
544
544
545
545
function isGlobalSourceFile(node: Node) {
@@ -1594,7 +1594,7 @@ namespace ts {
1594
1594
}
1595
1595
1596
1596
function createObjectType(objectFlags: ObjectFlags, symbol?: Symbol): ObjectType {
1597
- const type = <ObjectType>createType(TypeFlags.ObjectType );
1597
+ const type = <ObjectType>createType(TypeFlags.Object );
1598
1598
type.objectFlags = objectFlags;
1599
1599
type.symbol = symbol;
1600
1600
return type;
@@ -3600,7 +3600,7 @@ namespace ts {
3600
3600
}
3601
3601
3602
3602
function isConstructorType(type: Type): boolean {
3603
- return type.flags & TypeFlags.ObjectType && getSignaturesOfType(type, SignatureKind.Construct).length > 0;
3603
+ return type.flags & TypeFlags.Object && getSignaturesOfType(type, SignatureKind.Construct).length > 0;
3604
3604
}
3605
3605
3606
3606
function getBaseTypeNodeOfClass(type: InterfaceType): ExpressionWithTypeArguments {
@@ -3637,7 +3637,7 @@ namespace ts {
3637
3637
return unknownType;
3638
3638
}
3639
3639
const baseConstructorType = checkExpression(baseTypeNode.expression);
3640
- if (baseConstructorType.flags & TypeFlags.ObjectType ) {
3640
+ if (baseConstructorType.flags & TypeFlags.Object ) {
3641
3641
// Resolving the members of a class requires us to resolve the base class of that class.
3642
3642
// We force resolution here such that we catch circularities now.
3643
3643
resolveStructuredTypeMembers(<ObjectType>baseConstructorType);
@@ -3678,7 +3678,7 @@ namespace ts {
3678
3678
function resolveBaseTypesOfClass(type: InterfaceType): void {
3679
3679
type.resolvedBaseTypes = type.resolvedBaseTypes || emptyArray;
3680
3680
const baseConstructorType = <ObjectType>getBaseConstructorTypeOfClass(type);
3681
- if (!(baseConstructorType.flags & TypeFlags.ObjectType )) {
3681
+ if (!(baseConstructorType.flags & TypeFlags.Object )) {
3682
3682
return;
3683
3683
}
3684
3684
const baseTypeNode = getBaseTypeNodeOfClass(type);
@@ -4350,7 +4350,7 @@ namespace ts {
4350
4350
constructSignatures = getDefaultConstructSignatures(classType);
4351
4351
}
4352
4352
const baseConstructorType = getBaseConstructorTypeOfClass(classType);
4353
- if (baseConstructorType.flags & TypeFlags.ObjectType ) {
4353
+ if (baseConstructorType.flags & TypeFlags.Object ) {
4354
4354
members = createSymbolTable(getNamedMembers(members));
4355
4355
addInheritedMembers(members, getPropertiesOfObjectType(baseConstructorType));
4356
4356
}
@@ -4369,7 +4369,7 @@ namespace ts {
4369
4369
4370
4370
function resolveStructuredTypeMembers(type: StructuredType): ResolvedType {
4371
4371
if (!(<ResolvedType>type).members) {
4372
- if (type.flags & TypeFlags.ObjectType ) {
4372
+ if (type.flags & TypeFlags.Object ) {
4373
4373
if ((<ObjectType>type).objectFlags & ObjectFlags.Reference) {
4374
4374
resolveTypeReferenceMembers(<TypeReference>type);
4375
4375
}
@@ -4392,7 +4392,7 @@ namespace ts {
4392
4392
4393
4393
/** Return properties of an object type or an empty array for other types */
4394
4394
function getPropertiesOfObjectType(type: Type): Symbol[] {
4395
- if (type.flags & TypeFlags.ObjectType ) {
4395
+ if (type.flags & TypeFlags.Object ) {
4396
4396
return resolveStructuredTypeMembers(<ObjectType>type).properties;
4397
4397
}
4398
4398
return emptyArray;
@@ -4401,7 +4401,7 @@ namespace ts {
4401
4401
/** If the given type is an object type and that type has a property by the given name,
4402
4402
* return the symbol for that property. Otherwise return undefined. */
4403
4403
function getPropertyOfObjectType(type: Type, name: string): Symbol {
4404
- if (type.flags & TypeFlags.ObjectType ) {
4404
+ if (type.flags & TypeFlags.Object ) {
4405
4405
const resolved = resolveStructuredTypeMembers(<ObjectType>type);
4406
4406
const symbol = resolved.members[name];
4407
4407
if (symbol && symbolIsValue(symbol)) {
@@ -4574,7 +4574,7 @@ namespace ts {
4574
4574
*/
4575
4575
function getPropertyOfType(type: Type, name: string): Symbol {
4576
4576
type = getApparentType(type);
4577
- if (type.flags & TypeFlags.ObjectType ) {
4577
+ if (type.flags & TypeFlags.Object ) {
4578
4578
const resolved = resolveStructuredTypeMembers(<ObjectType>type);
4579
4579
const symbol = resolved.members[name];
4580
4580
if (symbol && symbolIsValue(symbol)) {
@@ -5273,7 +5273,7 @@ namespace ts {
5273
5273
return arity ? emptyGenericType : emptyObjectType;
5274
5274
}
5275
5275
const type = getDeclaredTypeOfSymbol(symbol);
5276
- if (!(type.flags & TypeFlags.ObjectType )) {
5276
+ if (!(type.flags & TypeFlags.Object )) {
5277
5277
error(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name);
5278
5278
return arity ? emptyGenericType : emptyObjectType;
5279
5279
}
@@ -5453,7 +5453,7 @@ namespace ts {
5453
5453
const len = typeSet.length;
5454
5454
const index = len && type.id > typeSet[len - 1].id ? ~len : binarySearchTypes(typeSet, type);
5455
5455
if (index < 0) {
5456
- if (!(flags & TypeFlags.ObjectType && (<ObjectType>type).objectFlags & ObjectFlags.Anonymous &&
5456
+ if (!(flags & TypeFlags.Object && (<ObjectType>type).objectFlags & ObjectFlags.Anonymous &&
5457
5457
type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method) && containsIdenticalType(typeSet, type))) {
5458
5458
typeSet.splice(~index, 0, type);
5459
5459
}
@@ -6060,7 +6060,7 @@ namespace ts {
6060
6060
if (type.flags & TypeFlags.TypeParameter) {
6061
6061
return mapper(<TypeParameter>type);
6062
6062
}
6063
- if (type.flags & TypeFlags.ObjectType ) {
6063
+ if (type.flags & TypeFlags.Object ) {
6064
6064
if ((<ObjectType>type).objectFlags & ObjectFlags.Anonymous) {
6065
6065
// If the anonymous type originates in a declaration of a function, method, class, or
6066
6066
// interface, in an object type literal, or in an object literal expression, we may need
@@ -6147,7 +6147,7 @@ namespace ts {
6147
6147
}
6148
6148
6149
6149
function getTypeWithoutSignatures(type: Type): Type {
6150
- if (type.flags & TypeFlags.ObjectType ) {
6150
+ if (type.flags & TypeFlags.Object ) {
6151
6151
const resolved = resolveStructuredTypeMembers(<ObjectType>type);
6152
6152
if (resolved.constructSignatures.length) {
6153
6153
const result = <ResolvedType>createObjectType(ObjectFlags.Anonymous, type.symbol);
@@ -6457,7 +6457,7 @@ namespace ts {
6457
6457
if (source === target || relation !== identityRelation && isSimpleTypeRelatedTo(source, target, relation)) {
6458
6458
return true;
6459
6459
}
6460
- if (source.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType ) {
6460
+ if (source.flags & TypeFlags.Object && target.flags & TypeFlags.Object ) {
6461
6461
const id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id;
6462
6462
const related = relation[id];
6463
6463
if (related !== undefined) {
@@ -6657,7 +6657,7 @@ namespace ts {
6657
6657
// In a check of the form X = A & B, we will have previously checked if A relates to X or B relates
6658
6658
// to X. Failing both of those we want to check if the aggregation of A and B's members structurally
6659
6659
// relates to X. Thus, we include intersection types on the source side here.
6660
- if (apparentSource.flags & (TypeFlags.ObjectType | TypeFlags.Intersection) && target.flags & TypeFlags.ObjectType ) {
6660
+ if (apparentSource.flags & (TypeFlags.Object | TypeFlags.Intersection) && target.flags & TypeFlags.Object ) {
6661
6661
// Report structural errors only if we haven't reported any errors yet
6662
6662
const reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & TypeFlags.Primitive);
6663
6663
if (result = objectTypeRelatedTo(apparentSource, source, target, reportStructuralErrors)) {
@@ -6668,10 +6668,10 @@ namespace ts {
6668
6668
}
6669
6669
6670
6670
if (reportErrors) {
6671
- if (source.flags & TypeFlags.ObjectType && target.flags & TypeFlags.Primitive) {
6671
+ if (source.flags & TypeFlags.Object && target.flags & TypeFlags.Primitive) {
6672
6672
tryElaborateErrorsForPrimitivesAndObjects(source, target);
6673
6673
}
6674
- else if (source.symbol && source.flags & TypeFlags.ObjectType && globalObjectType === source) {
6674
+ else if (source.symbol && source.flags & TypeFlags.Object && globalObjectType === source) {
6675
6675
reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
6676
6676
}
6677
6677
reportRelationError(headMessage, source, target);
@@ -6681,7 +6681,7 @@ namespace ts {
6681
6681
6682
6682
function isIdenticalTo(source: Type, target: Type): Ternary {
6683
6683
let result: Ternary;
6684
- if (source.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType ) {
6684
+ if (source.flags & TypeFlags.Object && target.flags & TypeFlags.Object ) {
6685
6685
if (getObjectFlags(source) & ObjectFlags.Reference && getObjectFlags(target) & ObjectFlags.Reference && (<TypeReference>source).target === (<TypeReference>target).target) {
6686
6686
// We have type references to same target type, see if all type arguments are identical
6687
6687
if (result = typeArgumentsRelatedTo(<TypeReference>source, <TypeReference>target, /*reportErrors*/ false)) {
@@ -6706,7 +6706,7 @@ namespace ts {
6706
6706
// index signatures, or if the property is actually declared in the object type. In a union or intersection
6707
6707
// type, a property is considered known if it is known in any constituent type.
6708
6708
function isKnownProperty(type: Type, name: string): boolean {
6709
- if (type.flags & TypeFlags.ObjectType ) {
6709
+ if (type.flags & TypeFlags.Object ) {
6710
6710
const resolved = resolveStructuredTypeMembers(<ObjectType>type);
6711
6711
if ((relation === assignableRelation || relation === comparableRelation) && (type === globalObjectType || isEmptyObjectType(resolved)) ||
6712
6712
resolved.stringIndexInfo ||
@@ -6734,7 +6734,7 @@ namespace ts {
6734
6734
}
6735
6735
6736
6736
function hasExcessProperties(source: FreshObjectLiteralType, target: Type, reportErrors: boolean): boolean {
6737
- if (maybeTypeOfKind(target, TypeFlags.ObjectType ) && !(getObjectFlags(target) & ObjectFlags.ObjectLiteralPatternWithComputedProperties)) {
6737
+ if (maybeTypeOfKind(target, TypeFlags.Object ) && !(getObjectFlags(target) & ObjectFlags.ObjectLiteralPatternWithComputedProperties)) {
6738
6738
for (const prop of getPropertiesOfObjectType(source)) {
6739
6739
if (!isKnownProperty(target, prop.name)) {
6740
6740
if (reportErrors) {
@@ -7007,7 +7007,7 @@ namespace ts {
7007
7007
}
7008
7008
7009
7009
function propertiesIdenticalTo(source: Type, target: Type): Ternary {
7010
- if (!(source.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType )) {
7010
+ if (!(source.flags & TypeFlags.Object && target.flags & TypeFlags.Object )) {
7011
7011
return Ternary.False;
7012
7012
}
7013
7013
const sourceProperties = getPropertiesOfObjectType(source);
@@ -7903,7 +7903,7 @@ namespace ts {
7903
7903
}
7904
7904
else {
7905
7905
source = getApparentType(source);
7906
- if (source.flags & TypeFlags.ObjectType ) {
7906
+ if (source.flags & TypeFlags.Object ) {
7907
7907
if (isInProcess(source, target)) {
7908
7908
return;
7909
7909
}
@@ -8295,7 +8295,7 @@ namespace ts {
8295
8295
type === falseType ? TypeFacts.FalseStrictFacts : TypeFacts.TrueStrictFacts :
8296
8296
type === falseType ? TypeFacts.FalseFacts : TypeFacts.TrueFacts;
8297
8297
}
8298
- if (flags & TypeFlags.ObjectType ) {
8298
+ if (flags & TypeFlags.Object ) {
8299
8299
return isFunctionObjectType(<ObjectType>type) ?
8300
8300
strictNullChecks ? TypeFacts.FunctionStrictFacts : TypeFacts.FunctionFacts :
8301
8301
strictNullChecks ? TypeFacts.ObjectStrictFacts : TypeFacts.ObjectFacts;
@@ -11732,7 +11732,7 @@ namespace ts {
11732
11732
11733
11733
// If type has a single call signature and no other members, return that signature. Otherwise, return undefined.
11734
11734
function getSingleCallSignature(type: Type): Signature {
11735
- if (type.flags & TypeFlags.ObjectType ) {
11735
+ if (type.flags & TypeFlags.Object ) {
11736
11736
const resolved = resolveStructuredTypeMembers(<ObjectType>type);
11737
11737
if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 &&
11738
11738
resolved.properties.length === 0 && !resolved.stringIndexInfo && !resolved.numberIndexInfo) {
@@ -13571,7 +13571,7 @@ namespace ts {
13571
13571
if (!isTypeAnyOrAllConstituentTypesHaveKind(leftType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbol)) {
13572
13572
error(left, Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol);
13573
13573
}
13574
- if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, TypeFlags.ObjectType | TypeFlags.TypeParameter)) {
13574
+ if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, TypeFlags.Object | TypeFlags.TypeParameter)) {
13575
13575
error(right, Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);
13576
13576
}
13577
13577
return booleanType;
@@ -16478,7 +16478,7 @@ namespace ts {
16478
16478
const rightType = checkNonNullExpression(node.expression);
16479
16479
// unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved
16480
16480
// in this case error about missing name is already reported - do not report extra one
16481
- if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, TypeFlags.ObjectType | TypeFlags.TypeParameter)) {
16481
+ if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, TypeFlags.Object | TypeFlags.TypeParameter)) {
16482
16482
error(node.expression, Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter);
16483
16483
}
16484
16484
@@ -19245,7 +19245,7 @@ namespace ts {
19245
19245
}
19246
19246
19247
19247
function isFunctionType(type: Type): boolean {
19248
- return type.flags & TypeFlags.ObjectType && getSignaturesOfType(type, SignatureKind.Call).length > 0;
19248
+ return type.flags & TypeFlags.Object && getSignaturesOfType(type, SignatureKind.Call).length > 0;
19249
19249
}
19250
19250
19251
19251
function getTypeReferenceSerializationKind(typeName: EntityName, location?: Node): TypeReferenceSerializationKind {
0 commit comments