| Package | Description |
|---|---|
| com.google.javascript.jscomp |
Provides the core compiler and its public API.
|
| com.google.javascript.jscomp.newtypes | |
| 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 |
|---|---|
TypeI |
GlobalTypeInfo.buildRecordTypeFromObject(ObjectTypeI obj) |
TypeI |
GlobalTypeInfo.createRecordType(Map<String,? extends TypeI> props) |
TypeI |
GlobalTypeInfo.createTypeFromCommentNode(Node n) |
TypeI |
GlobalTypeInfo.createUnionType(List<? extends TypeI> members) |
TypeI |
GlobalTypeInfo.evaluateTypeExpression(JSTypeExpression expr,
TypeIEnv<TypeI> typeEnv)
This method is only called by TTL and the typeEnv passed is the global scope.
|
TypeI |
GlobalTypeInfo.evaluateTypeExpressionInGlobalScope(JSTypeExpression expr) |
TypeI |
TypedVar.getTypeI() |
TypeI |
TypedScope.getTypeIOfThis() |
TypeI |
GlobalTypeInfo.instantiateGenericType(ObjectTypeI genericType,
com.google.common.collect.ImmutableList<? extends TypeI> typeArgs) |
| Modifier and Type | Method and Description |
|---|---|
TypeMatchingStrategy.MatchResult |
TypeMatchingStrategy.match(TypeI templateType,
TypeI type) |
| Modifier and Type | Method and Description |
|---|---|
TypeI |
GlobalTypeInfo.createRecordType(Map<String,? extends TypeI> props) |
TypeI |
GlobalTypeInfo.createUnionType(List<? extends TypeI> members) |
TypeI |
GlobalTypeInfo.evaluateTypeExpression(JSTypeExpression expr,
TypeIEnv<TypeI> typeEnv)
This method is only called by TTL and the typeEnv passed is the global scope.
|
TypeI |
GlobalTypeInfo.instantiateGenericType(ObjectTypeI genericType,
com.google.common.collect.ImmutableList<? extends TypeI> typeArgs) |
| Modifier and Type | Method and Description |
|---|---|
TypeI |
JSType.convertMethodToFunction() |
TypeI |
JSType.getEnumeratedTypeOfEnumObject() |
TypeI |
JSType.getGreatestSubtypeWithProperty(String pname) |
TypeI |
JSType.getLegacyResolvedType() |
TypeI |
JSType.getPropertyType(String propName) |
TypeI |
JSType.getReturnType() |
TypeI |
JSType.getTypeOfThis() |
TypeI |
JSType.meetWith(TypeI other) |
TypeI |
JSType.restrictByNotNullOrUndefined() |
| Modifier and Type | Method and Description |
|---|---|
Iterable<TypeI> |
JSType.getParameterTypes() |
com.google.common.collect.ImmutableList<? extends TypeI> |
JSType.getTemplateTypes() |
List<TypeI> |
JSType.getTypeParameters() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
JSType.isEquivalentTo(TypeI type) |
boolean |
JSType.isSubtypeOf(TypeI other) |
boolean |
JSType.isSubtypeWithoutStructuralTyping(TypeI other) |
TypeI |
JSType.meetWith(TypeI other) |
FunctionTypeI |
JSType.withReturnType(TypeI returnType) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
JSType.acceptsArguments(List<? extends TypeI> argumentTypes) |
JSType |
JSType.instantiateGenerics(List<? extends TypeI> typeiArgs)
If this type represents an uninstantiated nominal type or function, instantiate it using
the given type arguments.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
TypeIEnv<T extends TypeI>
A map from type names to types.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
FunctionTypeI |
interface |
ObjectTypeI |
| Modifier and Type | Method and Description |
|---|---|
<T extends TypeI> |
TypeIRegistry.getNativeType(JSTypeNative typeId) |
<T extends TypeI> |
TypeIRegistry.getType(String typeName)
Returns the type represented by typeName or null if not found.
|
| Modifier and Type | Method and Description |
|---|---|
TypeI |
TypeI.autobox() |
TypeI |
TypeIRegistry.buildRecordTypeFromObject(ObjectTypeI obj) |
TypeI |
FunctionTypeI.convertMethodToFunction()
Creates a new function type B based on the original function type A.
|
TypeI |
TypeIRegistry.createRecordType(Map<String,? extends TypeI> props)
Creates an anonymous structural type with the given properties.
|
TypeI |
TypeIRegistry.createTypeFromCommentNode(Node n) |
TypeI |
TypeIRegistry.createUnionType(List<? extends TypeI> variants) |
TypeI |
TypeIRegistry.evaluateTypeExpression(JSTypeExpression expr,
TypeIEnv<TypeI> typeEnv) |
TypeI |
TypeIRegistry.evaluateTypeExpressionInGlobalScope(JSTypeExpression expr) |
TypeI |
TypeI.getEnumeratedTypeOfEnumElement() |
TypeI |
ObjectTypeI.getEnumeratedTypeOfEnumObject()
If this type is an enum object, returns the declared type of the elements.
|
TypeI |
TypeI.getGreatestSubtypeWithProperty(String propName) |
TypeI |
ObjectTypeI.getLegacyResolvedType()
Only called on instances of NamedType.
|
TypeI |
ObjectTypeI.getPropertyType(String propName)
Returns the type of property propName on this object, or null if the property doesn't exist.
|
TypeI |
FunctionTypeI.getReturnType() |
TypeI |
Node.getTypeI() |
TypeI |
Node.getTypeIBeforeCast() |
TypeI |
Node.getTypeIIfOld()
Gets the OTI
JSType associated with this node if any, and null otherwise. |
TypeI |
FunctionTypeI.getTypeOfThis()
Gets the type of
this in this function. |
TypeI |
TypeIRegistry.instantiateGenericType(ObjectTypeI genericType,
com.google.common.collect.ImmutableList<? extends TypeI> typeArgs)
Instantiates genericType using typeArgs.
|
TypeI |
TypeI.meetWith(TypeI other) |
TypeI |
TypeI.restrictByNotNullOrUndefined()
If this is a union type, returns a union type that does not include
the null or undefined type.
|
| Modifier and Type | Method and Description |
|---|---|
Iterable<TypeI> |
FunctionTypeI.getParameterTypes() |
com.google.common.collect.ImmutableList<? extends TypeI> |
ObjectTypeI.getTemplateTypes()
For an instantiated generic type, return the types that the type variables are mapped to.
|
Collection<TypeI> |
TypeI.getTypeParameters()
If this type is a generic nominal type or function, return the type parameters as type
variables.
|
Iterable<? extends TypeI> |
TypeI.getUnionMembers()
If this type is a union type, returns a list of its members.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
TypeI.isEquivalentTo(TypeI type) |
boolean |
TypeI.isSubtypeOf(TypeI type) |
boolean |
TypeI.isSubtypeWithoutStructuralTyping(TypeI type) |
TypeI |
TypeI.meetWith(TypeI other) |
void |
Node.setTypeI(TypeI type) |
FunctionTypeI |
FunctionTypeI.withReturnType(TypeI yieldType)
Returns a function type that is the same as functionType except for the return type, which is
set to be returnType.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
FunctionTypeI.acceptsArguments(List<? extends TypeI> argumentTypes)
Checks if a call to this function with the given list of arguments is valid.
|
TypeI |
TypeIRegistry.createRecordType(Map<String,? extends TypeI> props)
Creates an anonymous structural type with the given properties.
|
TypeI |
TypeIRegistry.createUnionType(List<? extends TypeI> variants) |
TypeI |
TypeIRegistry.evaluateTypeExpression(JSTypeExpression expr,
TypeIEnv<TypeI> typeEnv) |
TypeI |
TypeIRegistry.instantiateGenericType(ObjectTypeI genericType,
com.google.common.collect.ImmutableList<? extends TypeI> typeArgs)
Instantiates genericType using typeArgs.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
StaticTypedRef<T extends TypeI>
The
StaticTypedRef tells us all the ways that a StaticTypedSlot
is used in a program. |
interface |
StaticTypedScope<T extends TypeI>
The
StaticTypedScope interface must be implemented by any object that
defines variables for the purposes of static analysis. |
interface |
StaticTypedSlot<T extends TypeI>
The
StaticTypedSlot interface must be implemented by variables that can
appear as members of a StaticTypedScope. |
| 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 |
JSType
Represents JavaScript value 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 |
TemplateType |
class |
TemplatizedType
An object type with declared template types, such as
Array<string>. |
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 | Method and Description |
|---|---|
TypeI |
FunctionType.convertMethodToFunction() |
TypeI |
ObjectType.getEnumeratedTypeOfEnumObject() |
TypeI |
Property.getTypeI() |
TypeI |
SimpleSlot.getTypeI() |
TypeI |
StaticTypedSlot.getTypeI()
Returns the type information as a
TypeI. |
TypeI |
StaticTypedScope.getTypeIOfThis()
Returns the expected type of
this in the current scope as a TypeI. |
TypeI |
JSTypeRegistry.instantiateGenericType(ObjectTypeI genericType,
com.google.common.collect.ImmutableList<? extends TypeI> typeArgs) |
TypeI |
JSType.meetWith(TypeI that) |
| Modifier and Type | Method and Description |
|---|---|
Iterable<TypeI> |
FunctionType.getParameterTypes() |
com.google.common.collect.ImmutableSet<TypeI> |
JSType.getTypeParameters() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
JSType.isEquivalentTo(TypeI that)
Checks if two types are equivalent.
|
boolean |
JSType.isEquivalentTo(TypeI that,
boolean isStructural) |
boolean |
JSType.isSubtypeOf(TypeI other) |
boolean |
JSType.isSubtypeWithoutStructuralTyping(TypeI that)
the logic of this method is similar to isSubtype,
except that it does not perform structural interface matching
This function is added for disambiguate properties,
and is deprecated for the other use cases.
|
TypeI |
JSType.meetWith(TypeI that) |
FunctionTypeI |
FunctionType.withReturnType(TypeI returnType) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
FunctionType.acceptsArguments(List<? extends TypeI> argumentTypes) |
JSType |
JSTypeRegistry.createRecordType(Map<String,? extends TypeI> props) |
JSType |
JSTypeRegistry.createTypeFromCommentNode(Node n,
String sourceName,
StaticTypedScope<? extends TypeI> scope)
Creates a JSType from the nodes representing a type.
|
JSType |
JSTypeRegistry.createUnionType(List<? extends TypeI> variants) |
JSType |
JSTypeRegistry.evaluateTypeExpression(JSTypeExpression expr,
TypeIEnv<TypeI> scope) |
TypeI |
JSTypeRegistry.instantiateGenericType(ObjectTypeI genericType,
com.google.common.collect.ImmutableList<? extends TypeI> typeArgs) |
Copyright © 2009-2017 Google. All Rights Reserved.