public class RecordType extends PrototypeObjectType
JSType.TypePair
templateTypeMap
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)
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, hasReferenceName, isAnonymous, isNativeObjectType, matchConstraint, matchesNumberContext, matchesObjectContext, matchesStringContext, matchRecordTypeConstraint, removeProperty, setPropertyJSDocInfo, setPropertyNode, unboxesTo
cast, clearCachedValues, createDelegateSuffix, defineDeclaredProperty, defineInferredProperty, defineSynthesizedProperty, findPropertyType, getDisplayName, getJSDocInfo, getNormalizedReferenceName, getOwnPropertyJSDocInfo, getOwnPropertyNames, getOwnSlot, getParentScope, getPossibleToBooleanOutcomes, getPropertiesCount, getPropertyNames, getPropertyNode, getPropertyType, getPropertyTypeMap, getRootNode, getSlot, getTemplateTypes, getTypeOfThis, hasOwnProperty, hasProperty, isFunctionPrototypeType, isObject, isPropertyInExterns, isPropertyTypeDeclared, isPropertyTypeInferred, isUnknownType, setJSDocInfo, testForEquality, visit
autobox, autoboxesTo, canCastTo, canTestForEqualityWith, canTestForShallowEqualityWith, collapseUnion, dereference, differsFrom, equals, extendTemplateTypeMap, getGreatestSubtype, getLeastSupertype, getRestrictedTypeGivenToBooleanOutcome, getTemplateTypeMap, getTypesUnderEquality, getTypesUnderInequality, getTypesUnderShallowEquality, getTypesUnderShallowInequality, hasAnyTemplateTypes, hasDisplayName, hashCode, isAllType, isArrayType, isBooleanObjectType, isBooleanValueType, isBottom, isCheckedUnknownType, isConstructor, isDateType, isDict, isEmptyType, isEnumElementType, isEnumType, isEquivalent, isEquivalentTo, isEquivalentTo, isExplicitlyVoidable, isFunctionType, isGlobalThisType, isInstanceType, isInterface, isNamedType, isNominalConstructor, isNominalType, isNoObjectType, isNoResolvedType, isNoType, isNullable, isNullType, isNumber, isNumberObjectType, isNumberValueType, isOrdinaryFunction, isRecordType, isRegexpType, isResolved, isString, isStringObjectType, isStringValueType, isStruct, isStructuralInterface, isSubtypeOf, isSubtypeWithoutStructuralTyping, isTemplateType, isTemplatizedType, isUnionType, isVoidable, isVoidType, matchesInt32Context, matchesUint32Context, resolve, restrictByNotNullOrUndefined, setValidator, toAnnotationString, toDebugHashCodeString, toMaybeEnumElementType, toMaybeEnumType, toMaybeFunctionType, toMaybeFunctionType, toMaybeNamedType, toMaybeObjectType, toMaybeTemplateType, toMaybeTemplatizedType, toMaybeUnionType, toNonNullAnnotationString, toObjectType, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isBottom, isConstructor, isEquivalentTo, isFunctionType, isInterface, isSubtypeOf, restrictByNotNullOrUndefined, toMaybeFunctionType, toMaybeObjectType
public ObjectType getImplicitPrototype()
ObjectType
[[Prototype]]
property).getImplicitPrototype
in class PrototypeObjectType
public RecordType toMaybeRecordType()
JSType
toMaybeRecordType
in class JSType
public boolean isStructuralType()
isStructuralType
in class ObjectType
public boolean isSubtype(JSType that)
JSType
this
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 PrototypeObjectType
this <: that
protected boolean isSubtype(JSType that, com.google.javascript.rhino.jstype.JSType.ImplCache implicitImplCache)
JSType
isSubtype
in class PrototypeObjectType
implicitImplCache
- 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–2023 Google. All rights reserved.