Class NoType
- All Implemented Interfaces:
JSType.WithSourceRef
Bottom type, representing the subclass of any value or object.
Although JavaScript programmers can't explicitly denote the bottom type,
it comes up in static analysis. For example, if we have:
var x = null;
if (x) {
f(x);
}
We need to be able to assign x a type within the f(x)
call. Since it has no possible type, we assign x the NoType,
so that f(x) is legal no matter what the type of f's
first argument is.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.javascript.rhino.jstype.FunctionType
FunctionType.Builder, FunctionType.ParameterNested classes/interfaces inherited from class com.google.javascript.rhino.jstype.JSType
JSType.HasPropertyKind, JSType.Nullability, JSType.SubtypingMode, JSType.TypePair, JSType.WithSourceRef -
Field Summary
Fields inherited from class com.google.javascript.rhino.jstype.JSType
templateTypeMap -
Method Summary
Modifier and TypeMethodDescriptionfinal BooleanLiteralSetComputes the set of possible outcomes of theToBooleanpredicate for this type.final booleanbooleanisNoType()final booleanTests whether this type is nullable.final booleanTests whether this type is voidable.final <T> TVisit this type with the given visitor.Methods inherited from class com.google.javascript.rhino.jstype.NoObjectType
getConstructor, getImplicitPrototype, getReferenceName, matchesNumberContext, matchesObjectContext, matchesStringContext, matchesSymbolContext, setPropertyJSDocInfo, toMaybeFunctionTypeMethods inherited from class com.google.javascript.rhino.jstype.FunctionType
acceptsArguments, builder, canBeCalled, checkExtendsLoop, clearCachedValues, forgetParameterAndReturnTypes, getAllImplementedInterfaces, getAncestorInterfaces, getBindReturnType, getCanonicalRepresentation, getClosurePrimitive, getConstructorOnlyTemplateParameters, getExtendedInterfaces, getExtendedInterfacesCount, getGoogModuleId, getImplementedInterfaces, getInstanceType, getMaxArity, getMinArity, getOwnImplementedInterfaces, getOwnPropertyNames, getParameters, getPropertyType, getPropertyTypeMap, getPrototype, getPrototypeProperty, getReturnType, getSlot, getSource, getSuperClassConstructor, getTypeOfThis, hasCachedValues, hasEqualCallType, hasImplementedInterfaces, hasInstanceType, hasProperties, isAbstract, isAmbiguousConstructor, isConstructor, isInstanceType, isInterface, isOrdinaryFunction, isReturnTypeInferred, isStructuralInterface, makesDicts, makesStructs, setDict, setExplicitUnrestricted, setExtendedInterfaces, setImplementedInterfaces, setImplicitMatch, setPrototypeBasedOn, setSource, setStruct, toBuilderMethods inherited from class com.google.javascript.rhino.jstype.PrototypeObjectType
getCtorExtendedInterfaces, getCtorImplementedInterfaces, getOwnerFunction, getTemplateParamCount, isAnonymous, isNativeObjectType, matchConstraint, matchRecordTypeConstraint, setPropertyNodeMethods inherited from class com.google.javascript.rhino.jstype.ObjectType
cast, createDelegateSuffix, defineDeclaredProperty, defineInferredProperty, defineSynthesizedProperty, findClosestDefinition, findPropertyTypeWithoutConsideringTemplateTypes, getClosestDefiningType, getDisplayName, getEnumeratedTypeOfEnumObject, getImplicitPrototypeChain, getJSDocInfo, getNormalizedReferenceName, getOwnPropertyDefSite, getOwnPropertyJSDocInfo, getOwnPropertyKind, getOwnSlot, getPropertiesCount, getPropertyDefSite, getPropertyJSDocInfo, getPropertyKind, getPropertyNames, getPropertyNode, getRawType, getTemplateTypes, hasOwnDeclaredProperty, hasOwnProperty, hasReferenceName, isFunctionPrototypeType, isObject, isPropertyInExterns, isPropertyTypeDeclared, isPropertyTypeInferred, isStructuralType, isUnknownType, setJSDocInfo, testForEqualityMethods inherited from class com.google.javascript.rhino.jstype.JSType
areSimilar, assertFunctionType, assertObjectType, autobox, autoboxesTo, canCastTo, canTestForEqualityWith, canTestForShallowEqualityWith, collapseUnion, containsReferenceAncestor, dereference, differsFrom, equals, findPropertyType, getEnumeratedTypeOfEnumElement, getGreatestSubtype, getLeastSupertype, getPropertyKind, getRestrictedTypeGivenOutcome, getTemplateTypeMap, getTypeParameters, getTypesUnderEquality, getTypesUnderInequality, getTypesUnderShallowEquality, getTypesUnderShallowInequality, getUnionMembers, hasAnyTemplateTypes, hasDisplayName, hashCode, hasProperty, isAllType, isArrayType, isBigIntObjectType, isBigIntOrNumber, isBigIntValueType, isBooleanObjectType, isBooleanValueType, isBoxableScalar, isCheckedUnknownType, isDateType, isDict, isEmptyType, isEnumElementType, isEnumType, isExplicitlyVoidable, isFunctionType, isGlobalThisType, isLiteralObject, isNamedType, isNominalConstructorOrInterface, isNominalType, isNoResolvedType, isNullType, isNumber, isNumberObjectType, isNumberValueType, isObjectType, isOnlyBigInt, isRawTypeOfTemplatizedType, isReadonlyArrayType, isRecordType, isRegexpType, isResolved, isSomeUnknownType, isString, isStringObjectType, isStringValueType, isStruct, isSubtype, isSubtype, isSubtypeOf, isSubtypeOf, isSubtypeWithoutStructuralTyping, isSuccessfullyResolved, isSymbol, isSymbolObjectType, isSymbolValueType, isTemplateType, isTemplatizedType, isUnionType, isUnsuccessfullyResolved, isVoidType, loosenTypecheckingDueToForwardReferencedSupertype, mergeSupertypeTemplateTypes, resolve, restrictByNotNull, restrictByNotNullOrUndefined, restrictByNotUndefined, setValidator, toAnnotationString, toMaybeEnumElementType, toMaybeEnumType, toMaybeFunctionType, toMaybeNamedType, toMaybeObjectType, toMaybeRecordType, toMaybeTemplateType, toMaybeTemplatizedType, toMaybeUnionType, toObjectType, toString
-
Method Details
-
isNoObjectType
public final boolean isNoObjectType()- Overrides:
isNoObjectTypein classNoObjectType
-
isNoType
public boolean isNoType() -
isNullable
public final boolean isNullable()Description copied from class:JSTypeTests whether this type is nullable.- Overrides:
isNullablein classJSType
-
isVoidable
public final boolean isVoidable()Description copied from class:JSTypeTests whether this type is voidable.- Overrides:
isVoidablein classJSType
-
getPossibleToBooleanOutcomes
Description copied from class:JSTypeComputes the set of possible outcomes of theToBooleanpredicate for this type. TheToBooleanpredicate is defined by the ECMA-262 standard, 3rd edition. Its behavior for simple types can be summarized by the following table:ToBoolean results by input type type result undefined{false} null{false} boolean{true, false} number{true, false} string{true, false} Object{true} - Overrides:
getPossibleToBooleanOutcomesin classObjectType- Returns:
- the set of boolean literals for this type
-
visit
Description copied from class:JSTypeVisit this type with the given visitor.- Overrides:
visitin classNoObjectType- Returns:
- the value returned by the visitor
- See Also:
-