public class RecordType extends PrototypeObjectType
JSType.SubtypingMode, JSType.TypePairTypeI.Nullability, TypeI.TypeInferencetemplateTypeMap| Modifier and Type | Method and Description |
|---|---|
ObjectType |
getImplicitPrototype()
Gets the implicit prototype (a.k.a.
|
boolean |
isStructuralType() |
boolean |
isSubtype(JSType that)
Checks whether
this is a subtype of that. |
protected boolean |
isSubtype(JSType that,
com.google.javascript.rhino.jstype.JSType.ImplCache implicitImplCache,
JSType.SubtypingMode subtypingMode)
checking isSubtype with structural interface matching
|
RecordType |
toMaybeRecordType()
Downcasts this to a RecordType, or returns null if this is not
a RecordType.
|
canBeCalled, getConstructor, getCtorExtendedInterfaces, getCtorImplementedInterfaces, getOwnerFunction, getReferenceName, hasCachedValues, hashCode, hasReferenceName, isAnonymous, isNativeObjectType, matchConstraint, matchesNumberContext, matchesObjectContext, matchesStringContext, matchRecordTypeConstraint, removeProperty, setPropertyJSDocInfo, setPropertyNode, unboxesTocast, clearCachedValues, createDelegateSuffix, defineDeclaredProperty, defineInferredProperty, defineSynthesizedProperty, findPropertyType, getDisplayName, getEnumeratedTypeOfEnumObject, getJSDocInfo, getLegacyResolvedType, getNormalizedReferenceName, getOwnPropertyDefSite, getOwnPropertyJSDocInfo, getOwnPropertyNames, getOwnSlot, getParentScope, getPossibleToBooleanOutcomes, getPropertiesCount, getPropertyDefSite, getPropertyJSDocInfo, getPropertyNames, getPropertyNode, getPropertyType, getPropertyTypeMap, getPrototypeObject, getRawType, getRootNode, getSlot, getSuperClassConstructor, getTemplateTypes, getTopDefiningInterface, getTypeOfThis, hasOwnProperty, hasProperty, instantiateGenericsWithUnknown, isAmbiguousObject, isFunctionPrototypeType, isObject, isPropertyInExterns, isPropertyTypeDeclared, isPropertyTypeInferred, isUnknownType, normalizeObjectForCheckAccessControls, setJSDocInfo, testForEquality, visitautobox, autoboxAndGetObject, autoboxesTo, canCastTo, canTestForEqualityWith, canTestForShallowEqualityWith, collapseUnion, containsArray, dereference, differsFrom, equals, extendTemplateTypeMap, getEnumeratedTypeOfEnumElement, getGreatestSubtype, getGreatestSubtypeWithProperty, getLeastSupertype, getRestrictedTypeGivenToBooleanOutcome, getTemplateTypeMap, getTypeParameters, getTypesUnderEquality, getTypesUnderInequality, getTypesUnderShallowEquality, getTypesUnderShallowInequality, getUnionMembers, hasAnyTemplateTypes, hasDisplayName, isAllType, isArrayType, isBooleanObjectType, isBooleanValueType, isBottom, isBoxableScalar, isCheckedUnknownType, isConstructor, isDateType, isDict, isEmptyType, isEnumElement, isEnumElementType, isEnumObject, isEnumType, isEquivalent, isEquivalentTo, isEquivalentTo, isExplicitlyVoidable, isFullyInstantiated, isFunctionType, isGenericObjectType, isGlobalThisType, isInstanceofObject, isInstanceType, isInterface, isLegacyNamedType, isLiteralObject, isNamedType, isNominalConstructor, isNominalType, isNoObjectType, isNoResolvedType, isNoType, isNullable, isNullType, isNumber, isNumberObjectType, isNumberValueType, isObjectType, isOrdinaryFunction, isPartiallyInstantiated, isPrototypeObject, isRecordType, isRegexpType, isResolved, isSomeUnknownType, isString, isStringObjectType, isStringValueType, isStruct, isStructuralInterface, isSubtype, isSubtypeOf, isSubtypeWithoutStructuralTyping, isTemplateType, isTemplatizedType, isTop, isTypeVariable, isUnionType, isUnresolved, isUnresolvedOrResolvedUnknown, isVoidable, isVoidType, matchesInt32Context, matchesUint32Context, meetWith, resolve, restrictByNotNullOrUndefined, setValidator, toAnnotationString, toDebugHashCodeString, toMaybeEnumElementType, toMaybeEnumType, toMaybeFunctionType, toMaybeFunctionType, toMaybeNamedType, toMaybeObjectType, toMaybeTemplateType, toMaybeTemplatizedType, toMaybeUnionType, toObjectType, toString, typeInferenceclone, finalize, getClass, notify, notifyAll, wait, wait, waitisInstanceType, isLegacyNamedTypeautobox, autoboxAndGetObject, containsArray, getEnumeratedTypeOfEnumElement, getGreatestSubtypeWithProperty, getTypeParameters, getUnionMembers, isBooleanValueType, isBottom, isBoxableScalar, isConstructor, isEnumElement, isEnumObject, isEquivalentTo, isFullyInstantiated, isFunctionType, isGenericObjectType, isInstanceofObject, isInterface, isLiteralObject, isNullable, isNullType, isNumberValueType, isObjectType, isPartiallyInstantiated, isPrototypeObject, isRecordType, isSomeUnknownType, isStringValueType, isStructuralInterface, isSubtypeOf, isSubtypeWithoutStructuralTyping, isTop, isTypeVariable, isUnionType, isUnresolved, isUnresolvedOrResolvedUnknown, isVoidable, isVoidType, meetWith, restrictByNotNullOrUndefined, toAnnotationString, toMaybeFunctionType, toMaybeObjectType, typeInferencepublic ObjectType getImplicitPrototype()
ObjectType[[Prototype]] property).getImplicitPrototype in class PrototypeObjectTypepublic RecordType toMaybeRecordType()
JSTypetoMaybeRecordType in class JSTypepublic boolean isStructuralType()
isStructuralType in class ObjectTypepublic boolean isSubtype(JSType that)
JSTypethis is a subtype of that.Note this function also returns true if this type structurally matches the protocol define by that type (if that type is an interface function type) Subtyping rules:
(T1, …, Tn) <: U if and only
Tk <: U for all k ∈ 1..n.U <: (T1, …, Tn) if and only
if U <: Tk for some index k.O1 is a subtype
of an object O2 if it has more properties
than O2 and all common properties are
pairwise subtypes.isSubtype in class PrototypeObjectTypethis <: thatprotected boolean isSubtype(JSType that, com.google.javascript.rhino.jstype.JSType.ImplCache implicitImplCache, JSType.SubtypingMode subtypingMode)
JSTypeisSubtype in class PrototypeObjectTypeimplicitImplCache - a cache that records the checked
or currently checking type pairs, for example, if previous
checking found that constructor C is a subtype of interface I,
then in the cache, table key <I,C> maps to IMPLEMENT status.Copyright © 2009-2017 Google. All Rights Reserved.