| Package | Description |
|---|---|
| com.google.javascript.jscomp |
Provides the core compiler and its public API.
|
| com.google.javascript.jscomp.type |
Provides type-checking data structures and algorithms.
|
| com.google.javascript.rhino |
The core AST from Rhino.
|
| com.google.javascript.rhino.jstype |
Provides abstractions to represent types in JavaScript.
|
| Modifier and Type | Method and Description |
|---|---|
abstract JSType |
TypeMismatch.getFound()
The RHS type; the type of the assignment target.
|
JSType |
TypedScope.getNamespaceOrTypedefType(java.lang.String typeName) |
abstract JSType |
TypeMismatch.getRequired()
The LHS type; the type being assigned.
|
JSType |
TypedVar.getType()
Gets this variable's type.
|
JSType |
TypedScope.getTypeOfThis()
Gets the type of
this in the current scope. |
JSType |
SymbolTable.SymbolScope.getTypeOfThis() |
| Modifier and Type | Method and Description |
|---|---|
static TypeMismatch |
TypeMismatch.createForTesting(JSType found,
JSType required) |
java.util.List<SymbolTable.Symbol> |
SymbolTable.getAllSymbolsForType(JSType type)
Gets all symbols associated with the given type.
|
boolean |
InvalidatingTypes.isInvalidating(JSType type) |
TypeMatchingStrategy.MatchResult |
TypeMatchingStrategy.match(JSType templateType,
JSType type) |
| Modifier and Type | Method and Description |
|---|---|
InvalidatingTypes.Builder |
InvalidatingTypes.Builder.writeInvalidationsInto(com.google.common.collect.Multimap<JSType,Node> invalidationMap) |
| Modifier and Type | Method and Description |
|---|---|
protected JSType |
ChainableReverseAbstractInterpreter.getTypeIfRefinable(Node node,
FlowScope scope)
Returns the type of a node in the given scope if the node corresponds to a
name whose type is capable of being refined.
|
| Modifier and Type | Method and Description |
|---|---|
protected FlowScope |
ChainableReverseAbstractInterpreter.declareNameInScope(FlowScope scope,
Node node,
JSType type)
Declares a refined type in
scope for the name represented by node. |
FlowScope |
FlowScope.inferQualifiedSlot(Node node,
java.lang.String symbol,
JSType bottomType,
JSType inferredType,
boolean declare)
Returns a flow scope with the type of the given
symbol updated to inferredType. |
FlowScope |
FlowScope.inferSlotType(java.lang.String symbol,
JSType type)
Returns a flow scope with the type of the given
symbol updated to type. |
| Modifier and Type | Method and Description |
|---|---|
JSType |
JSTypeExpression.evaluate(StaticTypedScope scope,
JSTypeRegistry registry)
Evaluates the type expression into a
JSType object. |
JSType |
Node.getJSType()
Returns the compiled inferred type on this node.
|
JSType |
Node.getJSTypeBeforeCast()
Returns the type of this node before casting.
|
JSType |
Node.getJSTypeRequired()
Returns the compiled inferred type on this node, or throws an NPE if there isn't one.
|
JSType |
Node.getTypedefTypeProp()
If this node represents a typedef declaration, the associated JSType
|
| Modifier and Type | Method and Description |
|---|---|
void |
NominalTypeBuilder.declareConstructorProperty(java.lang.String name,
JSType type,
Node defSite)
Declares a static property on the nominal type's constructor.
|
void |
NominalTypeBuilder.declareInstanceProperty(java.lang.String name,
JSType type,
Node defSite)
Declares an instance property on the nominal type.
|
void |
NominalTypeBuilder.declarePrototypeProperty(java.lang.String name,
JSType type,
Node defSite)
Declares a property on the nominal type's prototype.
|
Node |
Node.setJSType(JSType jstype) |
void |
Node.setJSTypeBeforeCast(JSType type)
Sets the type of this node before casting.
|
void |
Node.setTypedefTypeProp(JSType type)
If this node represents a typedef declaration, the associated JSType
|
| Modifier and Type | Class and Description |
|---|---|
class |
AllType
All type, representing all values.
|
class |
BooleanType
Boolean type.
|
class |
EnumElementType
The type of individual elements of an enum type
(see
EnumType). |
class |
EnumType
An enum type representing a branded collection of elements.
|
class |
FunctionType
This derived type provides extended information about a function, including its return type and
argument types.
|
class |
NamedType
A
NamedType is a named reference to some other type. |
class |
NoObjectType
The bottom Object type, representing the subclass of all objects.
|
class |
NoResolvedType
An unresolved type that was forward declared.
|
class |
NoType
Bottom type, representing the subclass of any value or object.
|
class |
NullType
Null type.
|
class |
NumberType
Number type.
|
class |
ObjectType
Object type.
|
class |
PrototypeObjectType
The object type represents instances of JavaScript objects such as
Object, Date, Function. |
class |
ProxyObjectType
An object type which uses composition to delegate all calls.
|
class |
RecordType
A record (structural) type.
|
class |
StringType
String type.
|
class |
SymbolType
Symbol type.
|
class |
TemplateType
A placeholder type, used as keys in
TemplateTypeMaps. |
class |
TemplatizedType
An object type with declared template types, such as
Array<string>. |
class |
UnionType
A type that may be any one of a set of types, and thus has the intersection of the properties of
those types.
|
class |
UnknownType
The
Unknown type. |
class |
VoidType
Void type whose only element is the
undefined value. |
| Modifier and Type | Field and Description |
|---|---|
JSType |
JSType.TypePair.typeA |
JSType |
JSType.TypePair.typeB |
| Modifier and Type | Method and Description |
|---|---|
JSType |
JSType.autobox()
Dereferences a type for property access.
|
JSType |
UnionType.autobox() |
JSType |
EnumElementType.autoboxesTo() |
JSType |
NumberType.autoboxesTo() |
JSType |
SymbolType.autoboxesTo() |
JSType |
JSType.autoboxesTo()
Turn a scalar type to the corresponding object type.
|
JSType |
StringType.autoboxesTo() |
JSType |
BooleanType.autoboxesTo() |
JSType |
RecordTypeBuilder.build()
Creates a record.
|
JSType |
UnionType.Builder.build()
Returns a type, not necessarily a
UnionType, that represents the union of the inputs. |
JSType |
JSTypeRegistry.buildRecordTypeFromObject(ObjectType objType) |
JSType |
TemplateTypeReplacer.caseAllType() |
JSType |
TemplateTypeReplacer.caseBooleanType() |
JSType |
TemplateTypeReplacer.caseEnumElementType(EnumElementType type) |
JSType |
TemplateTypeReplacer.caseFunctionType(FunctionType type) |
JSType |
TemplateTypeReplacer.caseNamedType(NamedType type) |
JSType |
TemplateTypeReplacer.caseNoObjectType() |
JSType |
TemplateTypeReplacer.caseNoType(NoType type) |
JSType |
TemplateTypeReplacer.caseNullType() |
JSType |
TemplateTypeReplacer.caseNumberType() |
JSType |
TemplateTypeReplacer.caseObjectType(ObjectType objType) |
JSType |
TemplateTypeReplacer.caseProxyObjectType(ProxyObjectType type) |
JSType |
TemplateTypeReplacer.caseStringType() |
JSType |
TemplateTypeReplacer.caseSymbolType() |
JSType |
TemplateTypeReplacer.caseTemplateType(TemplateType type) |
JSType |
TemplateTypeReplacer.caseTemplatizedType(TemplatizedType type) |
JSType |
TemplateTypeReplacer.caseUnionType(UnionType type) |
JSType |
TemplateTypeReplacer.caseUnknownType() |
JSType |
TemplateTypeReplacer.caseVoidType() |
JSType |
ProxyObjectType.collapseUnion() |
JSType |
JSType.collapseUnion()
Gets the least supertype of this that's not a union.
|
JSType |
UnionType.collapseUnion() |
JSType |
JSTypeRegistry.createFunctionTypeWithInstanceType(ObjectType instanceType,
JSType returnType,
java.util.List<JSType> parameterTypes)
Creates a function type in which
this refers to an object instance. |
JSType |
JSTypeRegistry.createNullableType(JSType type)
Creates a type representing nullable values of the given type.
|
JSType |
JSTypeRegistry.createOptionalNullableType(JSType type)
Creates a nullable and undefine-able value of the given type.
|
JSType |
JSTypeRegistry.createOptionalType(JSType type)
Creates a type representing optional values of the given type.
|
JSType |
JSTypeRegistry.createRecordType(java.util.Map<java.lang.String,? extends JSType> props) |
JSType |
JSTypeRegistry.createTypeFromCommentNode(Node n) |
JSType |
JSTypeRegistry.createTypeFromCommentNode(Node n,
java.lang.String sourceName,
StaticTypedScope scope)
Creates a JSType from the nodes representing a type.
|
JSType |
JSTypeRegistry.createUnionType(JSType... variants)
Creates a union type whose variants are the arguments.
|
JSType |
JSTypeRegistry.createUnionType(JSTypeNative... variants)
Creates a union type whose variants are the built-in types specified
by the arguments.
|
JSType |
JSTypeRegistry.createUnionType(java.util.List<? extends JSType> variants) |
JSType |
JSTypeRegistry.evaluateTypeExpression(JSTypeExpression expr,
StaticTypedScope scope) |
JSType |
JSTypeRegistry.evaluateTypeExpressionInGlobalScope(JSTypeExpression expr) |
JSType |
JSType.findPropertyType(java.lang.String propertyName)
Coerces this type to an Object type, then gets the type of the property whose name is given.
|
protected JSType |
EnumElementType.findPropertyTypeWithoutConsideringTemplateTypes(java.lang.String propertyName) |
protected JSType |
ProxyObjectType.findPropertyTypeWithoutConsideringTemplateTypes(java.lang.String propertyName) |
protected JSType |
JSType.findPropertyTypeWithoutConsideringTemplateTypes(java.lang.String propertyName)
Looks up a property on this type, but without properly replacing any templates in the result.
|
protected JSType |
UnionType.findPropertyTypeWithoutConsideringTemplateTypes(java.lang.String propertyName) |
protected JSType |
ObjectType.findPropertyTypeWithoutConsideringTemplateTypes(java.lang.String propertyName) |
JSType |
TemplateType.getBound() |
JSType |
JSType.getEnumeratedTypeOfEnumElement() |
JSType |
EnumType.getEnumeratedTypeOfEnumObject()
Gets the enumerated type.
|
JSType |
ObjectType.getEnumeratedTypeOfEnumObject() |
JSType |
JSTypeRegistry.getGlobalType(java.lang.String jsTypeName) |
JSType |
JSType.getGreatestSubtype(JSType that)
Gets the greatest subtype of
this and that. |
JSType |
JSTypeRegistry.getGreatestSubtypeWithProperty(JSType type,
java.lang.String propertyName)
Gets the greatest subtype of the
type that has a property propertyName defined
on it. |
JSType |
JSType.getGreatestSubtypeWithProperty(java.lang.String propName) |
JSType |
JSType.getLeastSupertype(JSType that)
Gets the least supertype of
this and that. |
JSType |
UnionType.getLeastSupertype(JSType that) |
JSType |
JSTypeRegistry.getNativeType(JSTypeNative typeId) |
JSType |
EnumElementType.getPrimitiveType()
Gets the primitive type of this enum element.
|
JSType |
FunctionType.getPropertyType(java.lang.String name) |
JSType |
TemplatizedType.getPropertyType(java.lang.String propertyName) |
JSType |
ObjectType.getPropertyType(java.lang.String propertyName)
Gets the property type of the property whose name is given.
|
JSType |
NamedType.getReferencedType()
Returns the type to which this refers (which is unknown if unresolved).
|
JSType |
TemplateTypeMap.getResolvedTemplateType(TemplateType key)
Returns the JSType value associated with the specified template key.
|
JSType |
JSType.getRestrictedTypeGivenOutcome(Outcome outcome)
Computes the restricted type of this type knowing that the
ToBoolean predicate has a specific value. |
JSType |
UnionType.getRestrictedTypeGivenOutcome(Outcome outcome) |
JSType |
UnionType.getRestrictedUnion(JSType type)
Returns a more restricted union type than
this one, in which all
subtypes of type have been removed. |
JSType |
FunctionType.getReturnType() |
JSType |
SimpleSlot.getType() |
JSType |
Property.getType() |
JSType |
StaticTypedSlot.getType()
Returns the type information, if any, for this slot.
|
JSType |
JSTypeRegistry.getType(StaticScope scope,
java.lang.String jsTypeName)
Looks up a native type by name.
|
JSType |
JSTypeRegistry.getType(StaticTypedScope scope,
java.lang.String jsTypeName,
java.lang.String sourceName,
int lineno,
int charno)
Looks up a type by name.
|
JSType |
JSTypeRegistry.getTypeForScope(StaticScope scope,
java.lang.String jsTypeName)
Looks up a native type by name.
|
JSType |
FunctionType.getTypeOfThis()
Gets the type of
this in this function. |
JSType |
ProxyObjectType.getTypeOfThis() |
JSType |
StaticTypedScope.getTypeOfThis()
Returns the expected type of
this in the current scope. |
JSType |
ObjectType.getTypeOfThis() |
default JSType |
StaticTypedScope.lookupQualifiedName(QualifiedName qname)
Looks up a given qualified name in the scope.
|
JSType |
JSType.resolve(ErrorReporter reporter)
Resolve this type in the given scope.
|
JSType |
JSType.restrictByNotNull()
If this is a union type, returns a union type that does not include the null type.
|
JSType |
NullType.restrictByNotNull() |
JSType |
UnionType.restrictByNotNull() |
JSType |
VoidType.restrictByNotNullOrUndefined() |
JSType |
JSType.restrictByNotNullOrUndefined()
If this is a union type, returns a union type that does not include
the null or undefined type.
|
JSType |
NullType.restrictByNotNullOrUndefined() |
JSType |
UnionType.restrictByNotNullOrUndefined() |
JSType |
VoidType.restrictByNotUndefined() |
JSType |
JSType.restrictByNotUndefined()
If this is a union type, returns a union type that does not include the undefined type.
|
JSType |
UnionType.restrictByNotUndefined() |
JSType |
JSType.unboxesTo()
Turn an object type to its corresponding scalar type.
|
JSType |
PrototypeObjectType.unboxesTo() |
| Modifier and Type | Method and Description |
|---|---|
com.google.common.collect.ImmutableList<JSType> |
UnionType.getAlternates()
Gets the alternate types of this union type.
|
java.lang.Iterable<JSType> |
FunctionType.getParameterTypes() |
java.util.Map<java.lang.String,JSType> |
FunctionType.getPropertyTypeMap()
get the map of properties to types covered in a function type
|
java.util.Map<java.lang.String,JSType> |
ObjectType.getPropertyTypeMap()
get the map of properties to types covered in an object type
|
com.google.common.collect.ImmutableList<JSType> |
NoResolvedType.getTemplateTypes() |
com.google.common.collect.ImmutableList<JSType> |
ProxyObjectType.getTemplateTypes() |
com.google.common.collect.ImmutableList<JSType> |
TemplatizedType.getTemplateTypes() |
com.google.common.collect.ImmutableList<JSType> |
NamedType.getTemplateTypes() |
com.google.common.collect.ImmutableList<JSType> |
ObjectType.getTemplateTypes()
Gets the declared default element type.
|
com.google.common.collect.ImmutableList<JSType> |
TemplateTypeMap.getTemplateValues() |
java.lang.Iterable<JSType> |
JSType.getUnionMembers() |
| Modifier and Type | Method and Description |
|---|---|
UnionType.Builder |
UnionType.Builder.addAlternate(JSType alternate)
Adds an alternate to the union type under construction.
|
boolean |
FunctionParamBuilder.addOptionalParams(JSType... types)
Add optional parameters of the given type to the end of the param list.
|
RecordTypeBuilder |
RecordTypeBuilder.addProperty(java.lang.String name,
JSType type,
Node propertyNode)
Adds a property with the given name and type to the record type.
|
boolean |
FunctionParamBuilder.addRequiredParams(JSType... types)
Add parameters of the given type to the end of the param list.
|
boolean |
FunctionParamBuilder.addVarArgs(JSType type)
Add variable arguments to the end of the parameter list.
|
static boolean |
JSType.areIdentical(JSType a,
JSType b) |
boolean |
JSType.canCastTo(JSType that)
Tests whether values of
this type can be safely assigned
to values of that type. |
JSTypeRegistry.PropDefinitionKind |
JSTypeRegistry.canPropertyBeDefined(JSType type,
java.lang.String propertyName)
Returns whether the given property can possibly be set on the given type.
|
boolean |
JSType.canTestForEqualityWith(JSType that)
Tests whether
this and that are meaningfully
comparable. |
boolean |
JSType.canTestForShallowEqualityWith(JSType that)
Tests whether
this and that are meaningfully
comparable using shallow comparison. |
protected abstract T |
Visitor.WithDefaultCase.caseDefault(JSType type)
Called for all cases unless the specific case is overridden in the concrete subclass.
|
static ObjectType |
ObjectType.cast(JSType type)
A null-safe version of JSType#toObjectType.
|
boolean |
UnionType.contains(JSType type)
A
UnionType contains a given type (alternate) iff the member
vector contains it. |
boolean |
JSType.containsReferenceAncestor(JSType target)
This function searchers for a type `target` in the reference chain of ProxyObjectTypes
|
FunctionType |
JSTypeRegistry.createConstructorType(java.lang.String name,
Node source,
Node parameters,
JSType returnType,
com.google.common.collect.ImmutableList<TemplateType> templateKeys,
boolean isAbstract)
Creates a constructor function type.
|
EnumType |
JSTypeRegistry.createEnumType(java.lang.String name,
Node source,
JSType elementsType)
Creates an enum type.
|
FunctionType |
JSTypeRegistry.createFunctionType(JSType returnType,
JSType... parameterTypes)
Creates a function type.
|
FunctionType |
JSTypeRegistry.createFunctionType(JSType returnType,
JSType... parameterTypes)
Creates a function type.
|
FunctionType |
JSTypeRegistry.createFunctionType(JSType returnType,
Node parameters) |
JSType |
JSTypeRegistry.createFunctionTypeWithInstanceType(ObjectType instanceType,
JSType returnType,
java.util.List<JSType> parameterTypes)
Creates a function type in which
this refers to an object instance. |
FunctionType |
JSTypeRegistry.createFunctionTypeWithNewReturnType(FunctionType existingFunctionType,
JSType returnType)
Creates a new function type based on an existing function type but
with a new return type.
|
FunctionType |
JSTypeRegistry.createFunctionTypeWithVarArgs(JSType returnType,
JSType... parameterTypes)
Creates a function type.
|
FunctionType |
JSTypeRegistry.createFunctionTypeWithVarArgs(JSType returnType,
JSType... parameterTypes)
Creates a function type.
|
JSType |
JSTypeRegistry.createNullableType(JSType type)
Creates a type representing nullable values of the given type.
|
JSType |
JSTypeRegistry.createOptionalNullableType(JSType type)
Creates a nullable and undefine-able value of the given type.
|
Node |
JSTypeRegistry.createOptionalParameters(JSType... parameterTypes)
Creates a tree hierarchy representing a typed parameter list in which
every parameter is optional.
|
JSType |
JSTypeRegistry.createOptionalType(JSType type)
Creates a type representing optional values of the given type.
|
Node |
JSTypeRegistry.createParameters(JSType... parameterTypes)
Creates a tree hierarchy representing a typed argument list.
|
Node |
JSTypeRegistry.createParametersWithVarArgs(JSType... parameterTypes)
Creates a tree hierarchy representing a typed argument list.
|
TemplateType |
JSTypeRegistry.createTemplateType(java.lang.String name,
JSType bound) |
TemplatizedType |
JSTypeRegistry.createTemplatizedType(ObjectType baseType,
JSType... templatizedTypes)
Creates a templatized instance of the specified type.
|
JSType |
JSTypeRegistry.createUnionType(JSType... variants)
Creates a union type whose variants are the arguments.
|
boolean |
JSTypeRegistry.declareType(StaticScope scope,
java.lang.String name,
JSType type)
Records declared global type names.
|
boolean |
JSTypeRegistry.declareTypeForExactScope(StaticScope scope,
java.lang.String name,
JSType type)
Records declared global type names.
|
boolean |
ObjectType.defineDeclaredProperty(java.lang.String propertyName,
JSType type,
Node propertyNode)
Defines a property whose type is explicitly declared by the programmer.
|
boolean |
ObjectType.defineInferredProperty(java.lang.String propertyName,
JSType type,
Node propertyNode)
Defines a property whose type is inferred.
|
boolean |
ObjectType.defineSynthesizedProperty(java.lang.String propertyName,
JSType type,
Node propertyNode)
Defines a property whose type is on a synthesized object.
|
boolean |
JSType.differsFrom(JSType that)
Whether this type is meaningfully different from
that type for the purposes of data
flow analysis. |
JSType |
JSType.getGreatestSubtype(JSType that)
Gets the greatest subtype of
this and that. |
JSType |
JSTypeRegistry.getGreatestSubtypeWithProperty(JSType type,
java.lang.String propertyName)
Gets the greatest subtype of the
type that has a property propertyName defined
on it. |
JSType |
JSType.getLeastSupertype(JSType that)
Gets the least supertype of
this and that. |
JSType |
UnionType.getLeastSupertype(JSType that) |
JSType |
UnionType.getRestrictedUnion(JSType type)
Returns a more restricted union type than
this one, in which all
subtypes of type have been removed. |
JSType.TypePair |
JSType.getTypesUnderEquality(JSType that)
Computes the subset of
this and that types if equality
is observed. |
JSType.TypePair |
UnionType.getTypesUnderEquality(JSType that) |
JSType.TypePair |
JSType.getTypesUnderInequality(JSType that)
Computes the subset of
this and that types if inequality
is observed. |
JSType.TypePair |
UnionType.getTypesUnderInequality(JSType that) |
JSType.TypePair |
JSType.getTypesUnderShallowEquality(JSType that)
Computes the subset of
this and that types under shallow
equality. |
JSType.TypePair |
JSType.getTypesUnderShallowInequality(JSType that)
Computes the subset of
this and that types under
shallow inequality. |
JSType.TypePair |
UnionType.getTypesUnderShallowInequality(JSType that) |
boolean |
JSType.isSubtype(JSType supertype)
Checks whether
this is a subtype of that. |
boolean |
JSType.isSubtype(JSType supertype,
JSType.SubtypingMode mode)
Deprecated.
Prefer
isSubtype(JSType) instead. |
boolean |
JSType.isSubtypeOf(JSType supertype) |
boolean |
JSType.isSubtypeOf(JSType supertype,
JSType.SubtypingMode mode) |
boolean |
JSType.isSubtypeWithoutStructuralTyping(JSType supertype)
the logic of this method is similar to isSubtype, except that it does not perform structural
interface matching
|
void |
ProxyObjectType.matchConstraint(JSType constraint) |
void |
JSType.matchConstraint(JSType constraint)
Modify this type so that it matches the specified type.
|
void |
UnionType.matchConstraint(JSType constraint) |
void |
PrototypeObjectType.matchConstraint(JSType constraint) |
void |
JSTypeRegistry.overwriteDeclaredType(StaticScope scope,
java.lang.String name,
JSType type)
Overrides a declared global type name.
|
void |
JSTypeRegistry.overwriteDeclaredType(java.lang.String name,
JSType type)
Overrides a declared global type name.
|
void |
JSTypeRegistry.registerClosureModule(java.lang.String moduleName,
Node definitionNode,
JSType type)
Ensures that a type annotation pointing to a Closure modules is correctly resolved.
|
void |
JSTypeRegistry.registerPropertyOnType(java.lang.String propertyName,
JSType type)
Tells the type system that
owner may have a property named
propertyName. |
void |
JSTypeRegistry.resetImplicitPrototype(JSType type,
ObjectType newImplicitProto)
Set the implicit prototype if it's possible to do so.
|
void |
TemplateType.setBound(JSType bound) |
TernaryValue |
VoidType.testForEquality(JSType that) |
TernaryValue |
EnumElementType.testForEquality(JSType that) |
TernaryValue |
AllType.testForEquality(JSType that) |
TernaryValue |
NumberType.testForEquality(JSType that) |
TernaryValue |
SymbolType.testForEquality(JSType that) |
TernaryValue |
ProxyObjectType.testForEquality(JSType that) |
TernaryValue |
JSType.testForEquality(JSType that)
Compares
this and that. |
TernaryValue |
UnknownType.testForEquality(JSType that) |
TernaryValue |
StringType.testForEquality(JSType that) |
TernaryValue |
NullType.testForEquality(JSType that) |
TernaryValue |
UnionType.testForEquality(JSType that) |
TernaryValue |
EnumType.testForEquality(JSType that) |
TernaryValue |
ObjectType.testForEquality(JSType that) |
TernaryValue |
BooleanType.testForEquality(JSType that) |
static FunctionType |
JSType.toMaybeFunctionType(JSType type)
Null-safe version of toMaybeFunctionType().
|
void |
JSTypeRegistry.unregisterPropertyOnType(java.lang.String propertyName,
JSType type)
Removes the index's reference to a property on the given type (if it is
currently registered).
|
FunctionType.Builder |
FunctionType.Builder.withInferredReturnType(JSType returnType)
Sets an inferred return type.
|
FunctionType.Builder |
FunctionType.Builder.withReturnType(JSType returnType)
Set the return type.
|
FunctionType.Builder |
FunctionType.Builder.withReturnType(JSType returnType,
boolean inferred)
Set the return type and whether it's inferred.
|
FunctionType.Builder |
FunctionType.Builder.withTypeOfThis(JSType typeOfThis)
Set the "this" type.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
FunctionType.acceptsArguments(java.util.List<? extends JSType> argumentTypes) |
UnionType.Builder |
UnionType.Builder.addAlternates(java.util.Collection<? extends JSType> c) |
UnionType.Builder |
UnionType.Builder.addAlternates(java.util.List<? extends JSType> list) |
TemplateTypeMap |
TemplateTypeMap.copyWithExtension(com.google.common.collect.ImmutableList<TemplateType> keys,
com.google.common.collect.ImmutableList<JSType> values)
Create a new map in which the keys and values have been extended by
keys and values respectively. |
JSType |
JSTypeRegistry.createFunctionTypeWithInstanceType(ObjectType instanceType,
JSType returnType,
java.util.List<JSType> parameterTypes)
Creates a function type in which
this refers to an object instance. |
JSType |
JSTypeRegistry.createRecordType(java.util.Map<java.lang.String,? extends JSType> props) |
TemplatizedType |
JSTypeRegistry.createTemplatizedType(ObjectType baseType,
com.google.common.collect.ImmutableList<JSType> templatizedTypes)
Creates a templatized instance of the specified type.
|
TemplatizedType |
JSTypeRegistry.createTemplatizedType(ObjectType baseType,
java.util.Map<TemplateType,JSType> templatizedTypes)
Creates a templatized instance of the specified type.
|
JSType |
JSTypeRegistry.createUnionType(java.util.List<? extends JSType> variants) |
static TemplateTypeReplacer |
TemplateTypeReplacer.forInference(JSTypeRegistry registry,
java.util.Map<TemplateType,JSType> bindings)
Creates a replacer for use during
TypeInference. |
boolean |
ProxyObjectType.setValidator(com.google.common.base.Predicate<JSType> validator) |
boolean |
NamedType.setValidator(com.google.common.base.Predicate<JSType> validator) |
boolean |
JSType.setValidator(com.google.common.base.Predicate<JSType> validator)
Certain types have constraints on them at resolution-time.
|
boolean |
TemplateType.setValidator(com.google.common.base.Predicate<JSType> validator) |
| Constructor and Description |
|---|
SimpleSlot(java.lang.String name,
JSType type,
boolean inferred) |
TypePair(JSType typeA,
JSType typeB) |
Copyright © 2009-2020 Google. All Rights Reserved.