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.
|
com.google.javascript.rhino.testing |
Modifier and Type | Method and Description |
---|---|
JSType |
ClosureCodingConvention.AssertInstanceofSpec.getAssertedType(Node call,
JSTypeRegistry registry)
Returns the type for a type assertion, or null if the function asserts
that the node must not be null or undefined.
|
JSType |
ClosureCodingConvention.AssertFunctionByTypeName.getAssertedType(Node call,
JSTypeRegistry registry)
Returns the type for a type assertion, or null if the function asserts
that the node must not be null or undefined.
|
JSType |
CodingConvention.AssertionFunctionSpec.getAssertedType(Node call,
JSTypeRegistry registry)
Returns the type for a type assertion, or null if the function asserts
that the node must not be null or undefined.
|
JSType |
Scope.Var.getType()
Gets this variable's type.
|
JSType |
Scope.getTypeOfThis()
Gets the type of
this in the current scope. |
JSType |
SymbolTable.SymbolScope.getTypeOfThis() |
Modifier and Type | Method and Description |
---|---|
StaticScope<JSType> |
Scope.getParentScope() |
StaticScope<JSType> |
Scope.getScope(Scope.Var var) |
Modifier and Type | Method and Description |
---|---|
List<SymbolTable.Symbol> |
SymbolTable.getAllSymbolsForType(JSType type)
Gets all symbols associated with the given type.
|
Modifier and Type | Method and Description |
---|---|
void |
CodingConvention.defineDelegateProxyPrototypeProperties(JSTypeRegistry registry,
StaticScope<JSType> scope,
List<ObjectType> delegateProxyPrototypes,
Map<String,String> delegateCallingConventions)
Defines the delegate proxy prototype properties.
|
void |
CodingConventions.Proxy.defineDelegateProxyPrototypeProperties(JSTypeRegistry registry,
StaticScope<JSType> scope,
List<ObjectType> delegateProxyPrototypes,
Map<String,String> delegateCallingConventions) |
Modifier and Type | Method and Description |
---|---|
protected JSType |
ChainableReverseAbstractInterpreter.getRestrictedWithoutNull(JSType type)
Returns a version of type where null is not present.
|
protected JSType |
ChainableReverseAbstractInterpreter.getRestrictedWithoutUndefined(JSType type)
Returns a version of type where undefined is not present.
|
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 |
---|---|
StaticSlot<JSType> |
FlowScope.findUniqueRefinedSlot(FlowScope blindScope)
Tries to find a unique refined variable in the refined scope, up to the
the blind scope.
|
Modifier and Type | Method and Description |
---|---|
protected void |
ChainableReverseAbstractInterpreter.declareNameInScope(FlowScope scope,
Node node,
JSType type)
Declares a refined type in
scope for the name represented by
node . |
protected JSType |
ChainableReverseAbstractInterpreter.getRestrictedWithoutNull(JSType type)
Returns a version of type where null is not present.
|
protected JSType |
ChainableReverseAbstractInterpreter.getRestrictedWithoutUndefined(JSType type)
Returns a version of type where undefined is not present.
|
void |
FlowScope.inferQualifiedSlot(Node node,
String symbol,
JSType bottomType,
JSType inferredType)
Infer the type of a qualified name.
|
void |
FlowScope.inferSlotType(String symbol,
JSType type)
Defines the type of a symbol at this point in the flow.
|
Modifier and Type | Method and Description |
---|---|
void |
FlowScope.completeScope(StaticScope<JSType> scope)
Look through the given scope, and try to find slots where it doesn't
have enough type information.
|
Modifier and Type | Method and Description |
---|---|
JSType |
JSTypeExpression.evaluate(StaticScope<JSType> scope,
JSTypeRegistry registry)
Evaluates the type expression into a
JSType object. |
JSType |
Node.getJSType() |
Modifier and Type | Method and Description |
---|---|
void |
Node.setJSType(JSType jsType) |
Modifier and Type | Method and Description |
---|---|
JSType |
JSTypeExpression.evaluate(StaticScope<JSType> scope,
JSTypeRegistry registry)
Evaluates the type expression into a
JSType object. |
Modifier and Type | Class and Description |
---|---|
class |
SimpleReference<T extends StaticSlot<JSType>>
A simple immutable reference.
|
interface |
StaticSymbolTable<S extends StaticSlot<JSType>,R extends StaticReference<JSType>>
Lookup references by the symbols that they refer to.
|
interface |
StaticSymbolTable<S extends StaticSlot<JSType>,R extends StaticReference<JSType>>
Lookup references by the symbols that they refer to.
|
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 |
NoType
Bottom type, representing the subclass of any value or object.
|
class |
NullType
Null type.
|
class |
NumberType
Number type.
|
class |
ObjectType
Object type.
|
class |
ProxyObjectType
An object type which uses composition to delegate all calls.
|
class |
RecordType
A record (structural) type.
|
class |
StringType
String type.
|
class |
TemplateType |
class |
TemplatizedType
An object type with declared template types, such as
Array. . |
class |
UnionType
The
UnionType implements a common JavaScript idiom in which the
code is specifically designed to work with multiple input 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 |
UnionType.autobox() |
JSType |
JSType.autobox()
Dereference a type for property access.
|
JSType |
BooleanType.autoboxesTo() |
JSType |
NumberType.autoboxesTo() |
JSType |
EnumElementType.autoboxesTo() |
JSType |
JSType.autoboxesTo()
Turn a scalar type to the corresponding object type.
|
JSType |
StringType.autoboxesTo() |
JSType |
RecordTypeBuilder.build()
Creates a record.
|
JSType |
ModificationVisitor.caseAllType() |
JSType |
ModificationVisitor.caseBooleanType() |
JSType |
ModificationVisitor.caseEnumElementType(EnumElementType type) |
JSType |
ModificationVisitor.caseFunctionType(FunctionType type) |
JSType |
ModificationVisitor.caseNamedType(NamedType type) |
JSType |
ModificationVisitor.caseNoObjectType() |
JSType |
ModificationVisitor.caseNoType(NoType type) |
JSType |
ModificationVisitor.caseNullType() |
JSType |
ModificationVisitor.caseNumberType() |
JSType |
ModificationVisitor.caseObjectType(ObjectType objType) |
JSType |
ModificationVisitor.caseProxyObjectType(ProxyObjectType type) |
JSType |
ModificationVisitor.caseStringType() |
JSType |
TemplateTypeMapReplacer.caseTemplateType(TemplateType type) |
JSType |
ModificationVisitor.caseTemplateType(TemplateType type) |
JSType |
ModificationVisitor.caseTemplatizedType(TemplatizedType type) |
JSType |
ModificationVisitor.caseUnionType(UnionType type) |
JSType |
ModificationVisitor.caseUnknownType() |
JSType |
ModificationVisitor.caseVoidType() |
JSType |
UnionType.collapseUnion() |
JSType |
ProxyObjectType.collapseUnion() |
JSType |
JSType.collapseUnion()
Gets the least supertype of this that's not a union.
|
JSType |
JSTypeRegistry.createDefaultObjectUnion(JSType type)
Creates a type representing nullable values of the given type.
|
JSType |
JSTypeRegistry.createFromTypeNodes(Node n,
String sourceName,
StaticScope<JSType> scope)
Creates a JSType from the nodes representing a type.
|
JSType |
JSTypeRegistry.createFunctionType(ObjectType instanceType,
JSType returnType,
List<JSType> parameterTypes)
Creates a function type in which
this refers to an object instance. |
JSType |
JSTypeRegistry.createFunctionTypeWithVarArgs(ObjectType instanceType,
JSType returnType,
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.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 |
UnionType.findPropertyType(String propertyName) |
JSType |
ObjectType.findPropertyType(String propertyName) |
JSType |
ProxyObjectType.findPropertyType(String propertyName) |
JSType |
EnumElementType.findPropertyType(String propertyName) |
JSType |
JSType.findPropertyType(String propertyName)
Coerces this type to an Object type, then gets the type of the property
whose name is given.
|
JSType |
JSType.getGreatestSubtype(JSType that)
Gets the greatest subtype of
this and that . |
JSType |
JSTypeRegistry.getGreatestSubtypeWithProperty(JSType type,
String propertyName)
Gets the greatest subtype of the
type that has a property
propertyName defined on it. |
JSType |
UnionType.getLeastSupertype(JSType that) |
JSType |
JSType.getLeastSupertype(JSType that)
Gets the least supertype of
this and that . |
JSType |
JSTypeRegistry.getNativeType(JSTypeNative typeId) |
JSType |
EnumElementType.getPrimitiveType()
Gets the primitive type of this enum element.
|
JSType |
TemplatizedType.getPropertyType(String propertyName) |
JSType |
ObjectType.getPropertyType(String propertyName)
Gets the property type of the property whose name is given.
|
JSType |
FunctionType.getPropertyType(String name) |
JSType |
NamedType.getReferencedType()
Returns the type to which this refers (which is unknown if unresolved).
|
JSType |
UnionType.getRestrictedTypeGivenToBooleanOutcome(boolean outcome) |
JSType |
JSType.getRestrictedTypeGivenToBooleanOutcome(boolean outcome)
Computes the restricted type of this type knowing that the
ToBoolean predicate has a specific value. |
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 |
TemplateTypeMap.getTemplateType(TemplateType key)
Returns the JSType value associated with the specified template key.
|
JSType |
Property.getType() |
JSType |
SimpleSlot.getType() |
JSType |
JSTypeRegistry.getType(StaticScope<JSType> scope,
String jsTypeName,
String sourceName,
int lineno,
int charno)
Looks up a type by name.
|
JSType |
JSTypeRegistry.getType(String jsTypeName)
Looks up a type by name.
|
JSType |
ObjectType.getTypeOfThis() |
JSType |
ProxyObjectType.getTypeOfThis() |
JSType |
FunctionType.getTypeOfThis()
Gets the type of
this in this function. |
JSType |
JSType.resolve(ErrorReporter t,
StaticScope<JSType> scope)
Resolve this type in the given scope.
|
JSType |
VoidType.restrictByNotNullOrUndefined() |
JSType |
UnionType.restrictByNotNullOrUndefined() |
JSType |
NullType.restrictByNotNullOrUndefined() |
JSType |
JSType.restrictByNotNullOrUndefined()
If this is a union type, returns a union type that does not include
the null or undefined type.
|
JSType |
JSType.unboxesTo()
Turn an object type to its corresponding scalar type.
|
Modifier and Type | Method and Description |
---|---|
Collection<JSType> |
UnionType.getAlternates()
Gets the alternate types of this union type.
|
StaticReference<JSType> |
SimpleSlot.getDeclaration() |
StaticScope<JSType> |
StaticSymbolTable.getScope(S symbol)
Returns the scope for a given symbol.
|
com.google.common.collect.ImmutableList<JSType> |
TemplatizedType.getTemplateTypes() |
com.google.common.collect.ImmutableList<JSType> |
ObjectType.getTemplateTypes()
Gets the declared default element type.
|
com.google.common.collect.ImmutableList<JSType> |
ProxyObjectType.getTemplateTypes() |
Iterable<JSType> |
JSTypeRegistry.getTypesWithProperty(String propertyName)
Returns each type that has a property
propertyName defined on it. |
Modifier and Type | Method and Description |
---|---|
boolean |
FunctionParamBuilder.addOptionalParams(JSType... types)
Add optional parameters of the given type to the end of the param list.
|
RecordTypeBuilder |
RecordTypeBuilder.addProperty(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.
|
boolean |
JSType.canCastTo(JSType that)
Tests whether values of
this type can be safely assigned
to values of that type. |
boolean |
JSTypeRegistry.canPropertyBeDefined(JSType type,
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. |
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. |
FunctionType |
JSTypeRegistry.createConstructorType(JSType returnType,
boolean lastVarArgs,
JSType... parameterTypes)
Creates a function type which can act as a constructor.
|
FunctionType |
JSTypeRegistry.createConstructorType(JSType returnType,
boolean lastVarArgs,
JSType... parameterTypes)
Creates a function type which can act as a constructor.
|
FunctionType |
JSTypeRegistry.createConstructorType(JSType returnType,
JSType... parameterTypes)
Creates a function type which can act as a constructor.
|
FunctionType |
JSTypeRegistry.createConstructorType(JSType returnType,
JSType... parameterTypes)
Creates a function type which can act as a constructor.
|
FunctionType |
JSTypeRegistry.createConstructorType(String name,
Node source,
Node parameters,
JSType returnType,
com.google.common.collect.ImmutableList<TemplateType> templateKeys)
Creates a constructor function type.
|
JSType |
JSTypeRegistry.createDefaultObjectUnion(JSType type)
Creates a type representing nullable values of the given type.
|
EnumType |
JSTypeRegistry.createEnumType(String name,
Node source,
JSType elementsType)
Creates an enum type.
|
FunctionType |
JSTypeRegistry.createFunctionType(JSType returnType,
boolean lastVarArgs,
JSType... parameterTypes)
Creates a function type.
|
FunctionType |
JSTypeRegistry.createFunctionType(JSType returnType,
boolean lastVarArgs,
JSType... parameterTypes)
Creates a function 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,
List<JSType> parameterTypes)
Creates a function type.
|
FunctionType |
JSTypeRegistry.createFunctionType(JSType returnType,
Node parameters) |
JSType |
JSTypeRegistry.createFunctionType(ObjectType instanceType,
JSType returnType,
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.
|
FunctionType |
JSTypeRegistry.createFunctionTypeWithVarArgs(JSType returnType,
List<JSType> parameterTypes)
Creates a function type.
|
JSType |
JSTypeRegistry.createFunctionTypeWithVarArgs(ObjectType instanceType,
JSType returnType,
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.
|
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.
|
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(String name,
JSType t)
Records declared global type names.
|
boolean |
ObjectType.defineDeclaredProperty(String propertyName,
JSType type,
Node propertyNode)
Defines a property whose type is explicitly declared by the programmer.
|
boolean |
ObjectType.defineInferredProperty(String propertyName,
JSType type,
Node propertyNode)
Defines a property whose type is inferred.
|
boolean |
ObjectType.defineSynthesizedProperty(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,
String propertyName)
Gets the greatest subtype of the
type that has a property
propertyName defined on it. |
JSType |
UnionType.getLeastSupertype(JSType that) |
JSType |
JSType.getLeastSupertype(JSType that)
Gets the least supertype of
this and 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 |
UnionType.getTypesUnderEquality(JSType that) |
JSType.TypePair |
JSType.getTypesUnderEquality(JSType that)
Computes the subset of
this and that types if equality
is observed. |
JSType.TypePair |
UnionType.getTypesUnderInequality(JSType that) |
JSType.TypePair |
JSType.getTypesUnderInequality(JSType that)
Computes the subset of
this and that types if inequality
is observed. |
JSType.TypePair |
JSType.getTypesUnderShallowEquality(JSType that)
Computes the subset of
this and that types under shallow
equality. |
JSType.TypePair |
UnionType.getTypesUnderShallowInequality(JSType that) |
JSType.TypePair |
JSType.getTypesUnderShallowInequality(JSType that)
Computes the subset of
this and that types under
shallow inequality. |
static boolean |
JSType.isEquivalent(JSType typeA,
JSType typeB) |
boolean |
JSType.isEquivalentTo(JSType that)
Checks if two types are equivalent.
|
boolean |
JSType.isInvariant(JSType that)
Checks if two types are invariant.
|
boolean |
NoType.isSubtype(JSType that) |
boolean |
TemplatizedType.isSubtype(JSType that) |
boolean |
UnionType.isSubtype(JSType that) |
boolean |
ProxyObjectType.isSubtype(JSType that) |
boolean |
EnumElementType.isSubtype(JSType that) |
boolean |
RecordType.isSubtype(JSType that) |
boolean |
JSType.isSubtype(JSType that)
Checks whether
this is a subtype of that . |
boolean |
NoObjectType.isSubtype(JSType that) |
boolean |
FunctionType.isSubtype(JSType that)
A function is a subtype of another if their call methods are related via
subtyping and
this is a subtype of that with regard to
the prototype chain. |
boolean |
UnknownType.isSubtype(JSType that) |
boolean |
EnumType.isSubtype(JSType that) |
boolean |
JSTypeRegistry.isTemplatizable(JSType type)
Checks whether the input type can be templatized.
|
void |
UnionType.matchConstraint(JSType constraint) |
void |
ProxyObjectType.matchConstraint(JSType constraint) |
void |
JSType.matchConstraint(JSType constraint)
Modify this type so that it matches the specified type.
|
void |
JSTypeRegistry.overwriteDeclaredType(String name,
JSType t)
Overrides a declared global type name.
|
void |
JSTypeRegistry.registerPropertyOnType(String propertyName,
JSType type)
Tells the type system that
owner may have a property named
propertyName . |
boolean |
JSTypeRegistry.resetImplicitPrototype(JSType type,
ObjectType newImplicitProto)
Set the implicit prototype if it's possible to do so.
|
TernaryValue |
VoidType.testForEquality(JSType that) |
TernaryValue |
UnionType.testForEquality(JSType that) |
TernaryValue |
BooleanType.testForEquality(JSType that) |
TernaryValue |
ObjectType.testForEquality(JSType that) |
TernaryValue |
NumberType.testForEquality(JSType that) |
TernaryValue |
ProxyObjectType.testForEquality(JSType that) |
TernaryValue |
AllType.testForEquality(JSType that) |
TernaryValue |
NullType.testForEquality(JSType that) |
TernaryValue |
EnumElementType.testForEquality(JSType that) |
TernaryValue |
JSType.testForEquality(JSType that)
Compares
this and that . |
TernaryValue |
StringType.testForEquality(JSType that) |
TernaryValue |
UnknownType.testForEquality(JSType that) |
TernaryValue |
EnumType.testForEquality(JSType that) |
static FunctionType |
JSType.toMaybeFunctionType(JSType type)
Null-safe version of toMaybeFunctionType().
|
static TemplateType |
JSType.toMaybeTemplateType(JSType type)
Null-safe version of toMaybeTemplateType().
|
static TemplatizedType |
JSType.toMaybeTemplatizedType(JSType type)
Null-safe version of toMaybeTemplatizedType().
|
void |
JSTypeRegistry.unregisterPropertyOnType(String propertyName,
JSType type)
Removes the index's reference to a property on the given type (if it is
currently registered).
|
FunctionBuilder |
FunctionBuilder.withInferredReturnType(JSType returnType)
Sets an inferred return type.
|
FunctionBuilder |
FunctionBuilder.withReturnType(JSType returnType)
Set the return type.
|
FunctionBuilder |
FunctionBuilder.withReturnType(JSType returnType,
boolean inferred)
Set the return type and whether it's inferred.
|
FunctionBuilder |
FunctionBuilder.withTypeOfThis(JSType typeOfThis)
Set the "this" type.
|
Modifier and Type | Method and Description |
---|---|
JSType |
JSTypeRegistry.createFromTypeNodes(Node n,
String sourceName,
StaticScope<JSType> scope)
Creates a JSType from the nodes representing a type.
|
FunctionType |
JSTypeRegistry.createFunctionType(JSType returnType,
List<JSType> parameterTypes)
Creates a function type.
|
JSType |
JSTypeRegistry.createFunctionType(ObjectType instanceType,
JSType returnType,
List<JSType> parameterTypes)
Creates a function type in which
this refers to an object instance. |
FunctionType |
JSTypeRegistry.createFunctionTypeWithVarArgs(JSType returnType,
List<JSType> parameterTypes)
Creates a function type.
|
JSType |
JSTypeRegistry.createFunctionTypeWithVarArgs(ObjectType instanceType,
JSType returnType,
List<JSType> parameterTypes)
Creates a function type in which
this refers to an object instance. |
Node |
JSTypeRegistry.createParameters(List<JSType> parameterTypes)
Creates a tree hierarchy representing a typed argument list.
|
Node |
JSTypeRegistry.createParametersWithVarArgs(List<JSType> parameterTypes)
Creates a tree hierarchy representing a typed argument list.
|
TemplateTypeMap |
JSTypeRegistry.createTemplateTypeMap(com.google.common.collect.ImmutableList<TemplateType> templateKeys,
com.google.common.collect.ImmutableList<JSType> templateValues)
Creates a template type map from the specified list of template keys and
template value types.
|
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,
Map<TemplateType,JSType> templatizedTypes)
Creates a templatized instance of the specified type.
|
JSType |
JSTypeRegistry.getType(StaticScope<JSType> scope,
String jsTypeName,
String sourceName,
int lineno,
int charno)
Looks up a type by name.
|
JSType |
JSType.resolve(ErrorReporter t,
StaticScope<JSType> scope)
Resolve this type in the given scope.
|
void |
JSTypeRegistry.resolveTypesInScope(StaticScope<JSType> scope)
Resolve all the unresolved types in the given scope.
|
boolean |
NamedType.setValidator(com.google.common.base.Predicate<JSType> validator) |
boolean |
UnionType.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.
|
Constructor and Description |
---|
SimpleSlot(String name,
JSType type,
boolean inferred) |
TypePair(JSType typeA,
JSType typeB) |
Modifier and Type | Field and Description |
---|---|
protected JSType |
BaseJSTypeTestCase.ALL_TYPE |
protected JSType |
BaseJSTypeTestCase.BOOLEAN_OBJECT_FUNCTION_TYPE |
protected JSType |
BaseJSTypeTestCase.BOOLEAN_TYPE |
protected JSType |
BaseJSTypeTestCase.DATE_FUNCTION_TYPE |
protected JSType |
BaseJSTypeTestCase.ERROR_FUNCTION_TYPE |
protected JSType |
BaseJSTypeTestCase.EVAL_ERROR_FUNCTION_TYPE |
protected JSType |
BaseJSTypeTestCase.GREATEST_FUNCTION_TYPE |
protected JSType |
BaseJSTypeTestCase.LEAST_FUNCTION_TYPE |
protected JSType |
BaseJSTypeTestCase.MATH_TYPE |
protected JSType |
BaseJSTypeTestCase.NULL_TYPE |
protected JSType |
BaseJSTypeTestCase.NULL_VOID |
protected JSType |
BaseJSTypeTestCase.NUMBER_OBJECT_FUNCTION_TYPE |
protected JSType |
BaseJSTypeTestCase.NUMBER_STRING_BOOLEAN |
protected JSType |
BaseJSTypeTestCase.NUMBER_TYPE |
protected JSType |
BaseJSTypeTestCase.OBJECT_NUMBER_STRING |
protected JSType |
BaseJSTypeTestCase.OBJECT_NUMBER_STRING_BOOLEAN |
protected JSType |
BaseJSTypeTestCase.OBJECT_PROTOTYPE |
protected JSType |
BaseJSTypeTestCase.RANGE_ERROR_FUNCTION_TYPE |
protected JSType |
BaseJSTypeTestCase.REFERENCE_ERROR_FUNCTION_TYPE |
protected JSType |
BaseJSTypeTestCase.REGEXP_FUNCTION_TYPE |
protected JSType |
BaseJSTypeTestCase.STRING_OBJECT_FUNCTION_TYPE |
protected JSType |
BaseJSTypeTestCase.STRING_TYPE |
protected JSType |
BaseJSTypeTestCase.SYNTAX_ERROR_FUNCTION_TYPE |
protected JSType |
BaseJSTypeTestCase.TYPE_ERROR_FUNCTION_TYPE |
protected JSType |
BaseJSTypeTestCase.URI_ERROR_FUNCTION_TYPE |
protected JSType |
BaseJSTypeTestCase.VOID_TYPE |
Modifier and Type | Method and Description |
---|---|
static <T extends JSType,S extends JSType> |
Asserts.assertTypeCollectionEquals(Iterable<T> a,
Iterable<S> b) |
static <T extends JSType,S extends JSType> |
Asserts.assertTypeCollectionEquals(Iterable<T> a,
Iterable<S> b) |
Modifier and Type | Method and Description |
---|---|
static JSType |
Asserts.assertResolvesToSame(JSType type) |
static JSType |
Asserts.assertValidResolve(JSType type) |
static JSType |
Asserts.assertValidResolve(JSType type,
StaticScope<JSType> scope) |
protected JSType |
BaseJSTypeTestCase.createNullableType(JSType type) |
protected JSType |
BaseJSTypeTestCase.createOptionalType(JSType type) |
protected JSType |
BaseJSTypeTestCase.createUnionType(JSType... variants) |
protected JSType |
BaseJSTypeTestCase.resolve(JSTypeExpression n,
String... warnings)
Resolves a type expression, expecting the given warnings.
|
Modifier and Type | Method and Description |
---|---|
StaticSlot<JSType> |
MapBasedScope.getSlot(String name) |
Modifier and Type | Method and Description |
---|---|
static void |
Asserts.assertEquivalenceOperations(JSType a,
JSType b)
For the given equivalent types, run all type operations that
should have trivial solutions (getGreatestSubtype, isEquivalentTo, etc)
|
static JSType |
Asserts.assertResolvesToSame(JSType type) |
protected void |
BaseJSTypeTestCase.assertTypeEquals(JSType a,
JSType b) |
static void |
Asserts.assertTypeEquals(JSType a,
JSType b) |
protected void |
BaseJSTypeTestCase.assertTypeEquals(JSType expected,
JSTypeExpression actual)
Asserts that a a type expression resolves to the correct
JSType . |
protected void |
BaseJSTypeTestCase.assertTypeEquals(JSType expected,
Node actual)
Asserts that a Node representing a type expression resolves to the
correct
JSType . |
protected void |
BaseJSTypeTestCase.assertTypeEquals(String msg,
JSType a,
JSType b) |
static void |
Asserts.assertTypeEquals(String message,
JSType a,
JSType b) |
protected void |
BaseJSTypeTestCase.assertTypeNotEquals(JSType a,
JSType b) |
static void |
Asserts.assertTypeNotEquals(JSType a,
JSType b) |
protected void |
BaseJSTypeTestCase.assertTypeNotEquals(String msg,
JSType a,
JSType b) |
static void |
Asserts.assertTypeNotEquals(String message,
JSType a,
JSType b) |
static JSType |
Asserts.assertValidResolve(JSType type) |
static JSType |
Asserts.assertValidResolve(JSType type,
StaticScope<JSType> scope) |
protected JSType |
BaseJSTypeTestCase.createNullableType(JSType type) |
protected JSType |
BaseJSTypeTestCase.createOptionalType(JSType type) |
protected TemplatizedType |
BaseJSTypeTestCase.createTemplatizedType(ObjectType baseType,
JSType... templatizedType) |
protected JSType |
BaseJSTypeTestCase.createUnionType(JSType... variants) |
Modifier and Type | Method and Description |
---|---|
static JSType |
Asserts.assertValidResolve(JSType type,
StaticScope<JSType> scope) |
protected TemplatizedType |
BaseJSTypeTestCase.createTemplatizedType(ObjectType baseType,
com.google.common.collect.ImmutableList<JSType> templatizedTypes) |
Constructor and Description |
---|
MapBasedScope(Map<String,? extends JSType> namesToTypes) |
Copyright © 2009–2014 Google. All rights reserved.