Package | Description |
---|---|
com.google.javascript.jscomp |
Provides the core compiler and its public API.
|
com.google.javascript.jscomp.lint | |
com.google.javascript.jscomp.type |
Provides type-checking data structures and algorithms.
|
com.google.javascript.refactoring | |
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 | Field and Description |
---|---|
private JSType |
TypeValidator.allValueTypes |
(package private) JSType |
ConformanceRules.BanThrowOfNonErrorTypes.errorObjType |
private JSType |
CheckEventfulObjectDisposal.googDisposableInterfaceType |
private JSType |
CheckEventfulObjectDisposal.googEventsEventHandlerType |
private JSType |
ConformanceRules.AbstractTypeRestrictionRule.nativeObjectType |
private JSType |
CheckAccessControls.noTypeSentinel |
private JSType |
TypeValidator.nullOrUndefined |
private JSType |
FunctionTypeBuilder.returnType |
private JSType |
FunctionTypeBuilder.thisType |
(package private) JSType |
InlineProperties.PropertyInfo.type |
private JSType |
NameReferenceGraph.Name.type |
(package private) JSType |
TypedScopeCreator.DeferredSetType.type |
private JSType |
TypedVar.type |
(package private) JSType |
TypeValidator.TypeMismatch.typeA |
(package private) JSType |
TypeValidator.TypeMismatch.typeB |
private JSType |
SymbolTable.SymbolScope.typeOfThis |
private JSType |
ConformanceRules.AbstractTypeRestrictionRule.whitelistedTypes |
Modifier and Type | Field and Description |
---|---|
private static java.util.Comparator<JSType> |
RuntimeTypeCheck.ALPHA |
private ArrayDeque<JSType> |
CheckAccessControls.currentClassStack |
private java.util.Map<JSType,java.util.Map<java.lang.String,java.util.List<java.lang.Integer>>> |
CheckEventfulObjectDisposal.disposeCalls |
private java.util.Set<JSType> |
CheckEventfulObjectDisposal.eventfulTypes |
private java.util.Map<java.lang.String,java.util.IdentityHashMap<JSType,ObjectType>> |
DisambiguateProperties.gtwpCache |
private com.google.common.collect.Multimap<JSType,java.lang.String> |
CheckAccessControls.initializedConstantProperties |
private com.google.common.collect.BiMap<JSType,java.lang.Integer> |
AmbiguateProperties.intForType
A map from JSType to a unique representative Integer.
|
private java.util.Set<JSType> |
AmbiguateProperties.invalidatingTypes
A set of types that invalidate properties from ambiguation.
|
private java.util.Set<JSType> |
DisambiguateProperties.invalidatingTypes |
private java.util.Set<JSType> |
InlineProperties.invalidatingTypes |
private java.util.Set<JSType> |
DisambiguateProperties.Property.recordInterfacesCache
For every property p and type t, we only need to run recordInterfaces
once.
|
private java.util.Map<JSType,AmbiguateProperties.JSTypeBitSet> |
AmbiguateProperties.relatedBitsets
A map from JSType to JSTypeBitSet representing the types related
to the type.
|
private java.util.Map<TemplateType,JSType> |
TypeInference.TemplateTypeReplacer.replacements |
(package private) java.util.Map<Node,JSType> |
DisambiguateProperties.Property.rootTypesByNode
A map from nodes that need renaming to the highest type in the prototype
chain containing the field for each node.
|
private StaticTypedScope<JSType> |
TypeTransformation.scope |
private java.util.Set<JSType> |
GatherExternProperties.ExtractRecordTypePropertyNames.seenTypes |
private java.util.Map<java.lang.String,StaticTypedSlot<JSType>> |
LinkedFlowScope.FlatFlowScopeCache.symbols |
private UnionFind<JSType> |
DisambiguateProperties.Property.types
All top types on which the field exists, grouped together if related.
|
(package private) java.util.Set<JSType> |
DisambiguateProperties.Property.typesToSkip
A set of types for which renaming this field should be skipped.
|
(package private) com.google.common.collect.ImmutableMap<java.lang.String,JSType> |
TypeTransformation.NameResolver.typeVars |
Modifier and Type | Method and Description |
---|---|
private JSType |
TypeTransformation.buildRecordTypeFromObject(ObjectType objType) |
JSType |
TypeInference.TemplateTypeReplacer.caseTemplateType(TemplateType type) |
private JSType |
TypeTransformation.createRecordType(com.google.common.collect.ImmutableMap<java.lang.String,JSType> props) |
private JSType |
TypeTransformation.createTemplatizedType(ObjectType baseType,
JSType[] params) |
private JSType |
TypeTransformation.createUnionType(JSType... variants) |
private static JSType |
CheckAccessControls.dereference(JSType type)
Dereference a type, autoboxing it and filtering out null.
|
private static JSType |
CheckEventfulObjectDisposal.dereference(JSType type) |
private JSType |
CheckEventfulObjectDisposal.Traversal.dereference(JSType type)
Dereference a type, autoboxing it and filtering out null.
|
(package private) JSType |
TypeTransformation.eval(Node ttlAst,
com.google.common.collect.ImmutableMap<java.lang.String,JSType> typeVars)
Evaluates the type transformation expression and returns the resulting
type.
|
(package private) JSType |
TypeTransformation.eval(Node ttlAst,
com.google.common.collect.ImmutableMap<java.lang.String,JSType> typeVars,
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> nameVars)
Evaluates the type transformation expression and returns the resulting
type.
|
private JSType |
TypeTransformation.evalConditional(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalInstanceOf(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalInternal(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalMaprecord(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalMapunion(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalNativeTypeExpr(Node ttlAst) |
private JSType |
TypeTransformation.evalOperationExpression(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalPrintType(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalPropType(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalRawTypeOf(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalRecord(Node record,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalRecordParam(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalRecordType(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalTemplateTypeOf(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalTemplatizedType(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalTypeExpression(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalTypeName(Node ttlAst) |
private JSType |
TypeTransformation.evalTypeOfVar(Node ttlAst) |
private JSType[] |
TypeTransformation.evalTypeParams(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
TypeTransformation.evalTypeVar(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
(package private) static JSType |
ConformanceRules.ConformanceUtil.evaluateTypeString(AbstractCompiler compiler,
java.lang.String expression) |
private JSType |
TypeTransformation.evalUnionType(Node ttlAst,
TypeTransformation.NameResolver nameResolver) |
private JSType |
CheckMissingReturn.explicitReturnExpected(Node scope)
Determines if the given scope should explicitly return.
|
private JSType |
TypeCheck.findObjectWithNonStringifiableKey(JSType type)
Checks whether type (or one of its component if is composed type like union or templatized
type) has Object with non-stringifiable key.
|
private JSType |
TypeTransformation.getAllType() |
JSType |
ClosureCodingConvention.AssertInstanceofSpec.getAssertedOldType(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.getAssertedOldType(Node call,
JSTypeRegistry registry) |
JSType |
CodingConvention.AssertionFunctionSpec.getAssertedOldType(Node call,
JSTypeRegistry registry)
Returns the old type system type for a type assertion, or null if
the function asserts that the node must not be null or undefined.
|
private JSType |
CheckAccessControls.getClassOfMethod(Node n,
Node parent)
Gets the type of the class that "owns" a method, or null if
we know that its un-owned.
|
private JSType |
CheckAccessControls.getCurrentClass() |
private JSType |
TypedScopeCreator.AbstractScopeBuilder.getDeclaredRValueType(Node lValue,
Node rValue)
Check for common idioms of a typed R-value assigned to a const L-value.
|
(package private) JSType |
TypedScopeCreator.AbstractScopeBuilder.getDeclaredType(JSDocInfo info,
Node lValue,
Node rValue)
Look for a type declaration on a property assignment
(in an ASSIGN or an object literal key).
|
private JSType |
TypedScopeCreator.AbstractScopeBuilder.getDeclaredTypeInAnnotation(Node node,
JSDocInfo info)
Returns the type specified in a JSDoc annotation near a GETPROP or NAME.
|
private static JSType |
CheckAccessControls.getFinalParentClass(JSType type)
Returns the super class of the given type that has a constructor.
|
private JSType |
DisambiguateProperties.getInstanceFromPrototype(JSType type) |
(package private) static JSType |
ConformanceRules.ConformanceUtil.getJSType(AbstractCompiler compiler,
Node n)
This method gets the JSType from the Node argument and verifies that it is
present.
|
private JSType |
AmbiguateProperties.getJSType(Node n)
This method gets the JSType from the Node argument and verifies that it is
present.
|
private JSType |
InlineProperties.getJSType(Node n)
This method gets the JSType from the Node argument and verifies that it is
present.
|
private JSType |
TypeCheck.getJSType(Node n)
This method gets the JSType from the Node argument and verifies that it is
present.
|
private JSType |
TypeInference.getJSType(Node n)
This method gets the JSType from the Node argument and verifies that it is
present.
|
private JSType |
TypeValidator.getJSType(Node n)
This method gets the JSType from the Node argument and verifies that it is
present.
|
(package private) static JSType |
ConformanceRules.ConformanceUtil.getNativeType(AbstractCompiler compiler,
JSTypeNative typeId) |
private JSType |
TypeCheck.getNativeType(JSTypeNative typeId) |
private JSType |
TypeInference.getNativeType(JSTypeNative typeId) |
private JSType |
TypeValidator.getNativeType(JSTypeNative typeId) |
private JSType |
TypedScopeCreator.getNativeType(JSTypeNative nativeType) |
private JSType |
TypeTransformation.getNoType() |
(package private) static JSType |
TypeCheck.getObjectLitKeyTypeFromValueType(Node key,
JSType valueType) |
private JSType |
TypeTransformation.getObjectType() |
private JSType |
TypeInference.getPropertyType(JSType objType,
java.lang.String propName,
Node n,
FlowScope scope) |
JSType |
NameReferenceGraph.Name.getType() |
JSType |
TypedVar.getType()
Gets this variable's type.
|
private JSType |
DisambiguateProperties.getType(Node node) |
private JSType |
NameReferenceGraphConstruction.getType(Node n)
A helper to retrieve the type of a node.
|
private JSType |
SymbolTable.getType(StaticSlot sym) |
private JSType |
TypeTransformation.getType(java.lang.String name) |
JSType |
LinkedFlowScope.getTypeOfThis() |
JSType |
PreprocessorSymbolTable.getTypeOfThis() |
JSType |
SymbolTable.SymbolScope.getTypeOfThis() |
JSType |
TypedScope.getTypeOfThis()
Gets the type of
this in the current scope. |
private JSType |
SymbolTable.getTypeOfThis(StaticScope s) |
private static JSType |
CheckEventfulObjectDisposal.getTypeOfThisForScope(NodeTraversal t) |
private JSType |
TypeTransformation.getUnknownType() |
private JSType |
TypeTransformation.joinRecordTypes(com.google.common.collect.ImmutableList<RecordType> recTypes)
Merges a list of record types.
|
private JSType |
TypedScopeCreator.AbstractScopeBuilder.lookupQualifiedName(Node n) |
private JSType |
InlineProperties.GatherCandidates.maybeGetInstanceTypeFromPrototypeRef(Node src) |
private JSType |
CheckEventfulObjectDisposal.maybeReturnDisposedType(Node n,
boolean checkDispose) |
private static JSType |
CheckAccessControls.normalizeClassType(JSType type)
Normalize the type of a constructor, its instance, and its prototype
all down to the same type (the instance type).
|
private JSType |
DisambiguateProperties.FindRenameableProperties.processProperty(NodeTraversal t,
DisambiguateProperties.Property prop,
JSType type,
JSType relatedType)
Processes a property, adding it to the list of properties to rename.
|
private JSType |
TypedCodeGenerator.restrictByUndefined(JSType type) |
protected JSType |
ConformanceRules.AbstractTypeRestrictionRule.union(java.util.List<java.lang.String> typeNames) |
Modifier and Type | Method and Description |
---|---|
private java.util.Map<java.lang.String,StaticTypedSlot<JSType>> |
LinkedFlowScope.allFlowSlots()
Gets all the symbols that have been defined before this point
in the current flow.
|
private java.util.Map<JSType,java.lang.String> |
DisambiguateProperties.buildPropNames(DisambiguateProperties.Property prop)
Chooses a name to use for renaming in each equivalence class and maps
the representative type of that class to that name.
|
private java.util.Map<java.lang.String,JSType> |
TypeInference.buildTypeVariables(java.util.Map<TemplateType,JSType> inferredTypes)
Build the type environment where type transformations will be evaluated.
|
private java.util.Map<TemplateType,JSType> |
TypeInference.evaluateTypeTransformations(com.google.common.collect.ImmutableList<TemplateType> templateTypes,
java.util.Map<TemplateType,JSType> inferredTypes)
This function will evaluate the type transformations associated to the
template types
|
StaticTypedSlot<JSType> |
LinkedFlowScope.findUniqueRefinedSlot(FlowScope blindScope)
Iterate through all the linked flow scopes before this one.
|
StaticTypedSlot<JSType> |
LinkedFlowScope.getOwnSlot(java.lang.String name) |
StaticTypedScope<JSType> |
LinkedFlowScope.getParentScope() |
StaticTypedScope<JSType> |
PreprocessorSymbolTable.getParentScope() |
StaticTypedScope<JSType> |
TypedScope.getParentScope() |
(package private) com.google.common.collect.Multimap<java.lang.String,java.util.Collection<JSType>> |
DisambiguateProperties.getRenamedTypesForTesting()
Returns a map from field name to types for which it will be renamed.
|
StaticTypedScope<JSType> |
PreprocessorSymbolTable.getScope(SimpleSlot slot) |
private StaticTypedScope<JSType> |
TypeTransformation.getScope(StaticTypedScope<JSType> scope,
java.lang.String name) |
StaticTypedSlot<JSType> |
LinkedFlowScope.getSlot(java.lang.String name)
Get the slot for the given symbol.
|
StaticTypedSlot<JSType> |
LinkedFlowScope.FlatFlowScopeCache.getSlot(java.lang.String name)
Get the slot for the given symbol.
|
private java.lang.Iterable<JSType> |
DisambiguateProperties.getTypeAlternatives(JSType type)
Returns the alternatives if this is a type that represents multiple
types, and null if not.
|
(package private) UnionFind<JSType> |
DisambiguateProperties.Property.getTypes()
Returns the types on which this field is referenced.
|
private com.google.common.collect.ImmutableSet<JSType> |
DisambiguateProperties.getTypesToSkipForType(JSType type)
Returns a set of types that should be skipped given the given type.
|
private java.util.Set<JSType> |
DisambiguateProperties.getTypesToSkipForTypeNonUnion(JSType type) |
private java.util.Map<TemplateType,JSType> |
TypeInference.inferTemplateTypesFromParameters(FunctionType fnType,
Node call) |
Modifier and Type | Method and Description |
---|---|
private void |
CheckEventfulObjectDisposal.ComputeEventizeTraversal.addEventize(JSType thisType,
JSType thatType) |
private void |
CheckEventfulObjectDisposal.ComputeEventizeTraversal.addEventizeClass(java.lang.String className,
JSType thatType) |
private void |
AmbiguateProperties.addInvalidatingType(JSType type)
Invalidates the given type, so that no properties on it will be renamed.
|
private void |
DisambiguateProperties.addInvalidatingType(JSType type) |
private void |
InlineProperties.addInvalidatingType(JSType type)
Invalidates the given type, so that no properties on it will be renamed.
|
private void |
AmbiguateProperties.Property.addNonUnionType(JSType newType) |
private boolean |
FunctionTypeBuilder.addParameter(FunctionParamBuilder builder,
JSType paramType,
boolean warnedAboutArgList,
boolean isOptional,
boolean isVarArgs)
Add a parameter to the param list.
|
private SymbolTable.Symbol |
SymbolTable.addSymbol(java.lang.String name,
JSType type,
boolean inferred,
SymbolTable.SymbolScope scope,
Node declNode) |
(package private) void |
AmbiguateProperties.Property.addType(JSType newType)
Add this type to this property, calculating
|
(package private) void |
DisambiguateProperties.Property.addType(JSType type,
JSType relatedType)
Record that this property is referenced from this type.
|
(package private) void |
DisambiguateProperties.Property.addTypeToSkip(JSType type)
Records the given type as one to skip for this property.
|
boolean |
FunctionTypeBuilder.ExtendedTypeValidator.apply(JSType type) |
boolean |
FunctionTypeBuilder.ImplementedTypeValidator.apply(JSType type) |
private void |
TypeCheck.checkDeclaredPropertyInheritance(NodeTraversal t,
Node n,
FunctionType ctorType,
java.lang.String propertyName,
JSDocInfo info,
JSType propertyType)
Given a constructor type and a property name, check that the property has
the JSDoc annotation @override iff the property is declared on a
superclass.
|
private void |
CheckAccessControls.checkNonOverriddenPropertyVisibility(NodeTraversal t,
Node getprop,
Node parent,
JSDocInfo.Visibility visibility,
boolean isClassType,
JSType objectType,
StaticSourceFile referenceSource,
StaticSourceFile definingSource) |
private void |
CheckAccessControls.checkPrivatePropertyVisibility(NodeTraversal t,
Node getprop,
Node parent,
boolean isClassType,
JSType ownerType) |
private void |
TypeCheck.checkPropertyAccess(JSType childType,
java.lang.String propName,
NodeTraversal t,
Node n)
Emit a warning if we can prove that a property cannot possibly be
defined on an object.
|
private void |
TypeCheck.checkPropertyAccessHelper(JSType objectType,
java.lang.String propName,
NodeTraversal t,
Node n) |
private void |
TypeCheck.checkPropertyInheritanceOnGetpropAssign(NodeTraversal t,
Node assign,
Node object,
java.lang.String property,
JSDocInfo info,
JSType propertyType) |
private void |
CheckAccessControls.checkProtectedPropertyVisibility(NodeTraversal t,
Node getprop,
JSType ownerType) |
private boolean |
CheckEventfulObjectDisposal.ComputeEventizeTraversal.collectorFilterType(JSType type) |
private void |
AmbiguateProperties.computeRelatedTypes(JSType type)
Adds subtypes - and implementors, in the case of interfaces - of the type
to its JSTypeBitSet of related types.
|
private boolean |
ConformanceRules.BanUnresolvedType.conforms(JSType type) |
private static boolean |
TypeValidator.containsForwardDeclaredUnresolvedName(JSType type) |
private Node |
RuntimeTypeCheck.AddChecks.createCheckerNode(JSType type)
Creates a node which evaluates to a checker for the given type (which
must not be a union).
|
private Node |
RuntimeTypeCheck.AddChecks.createCheckTypeCallNode(JSType type,
Node expr)
Creates a function call to check that the given expression matches the
given type at runtime.
|
private Node |
TemplateAstMatcher.createTemplateParameterNode(int index,
JSType type) |
private JSType |
TypeTransformation.createTemplatizedType(ObjectType baseType,
JSType[] params) |
private JSType |
TypeTransformation.createUnionType(JSType... variants) |
(package private) TypedVar |
TypedScope.declare(java.lang.String name,
Node nameNode,
JSType type,
CompilerInput input) |
(package private) TypedVar |
TypedScope.declare(java.lang.String name,
Node nameNode,
JSType type,
CompilerInput input,
boolean inferred) |
private static void |
TypedScopeCreator.declareNativeType(TypedScope scope,
java.lang.String name,
JSType t) |
private SymbolTable.Symbol |
SymbolTable.declareSymbol(java.lang.String name,
JSType type,
boolean inferred,
SymbolTable.SymbolScope scope,
Node declNode,
JSDocInfo info) |
private void |
TypedScopeCreator.AbstractScopeBuilder.defineSlot(Node name,
Node parent,
JSType type)
Defines a typed variable.
|
(package private) void |
TypedScopeCreator.AbstractScopeBuilder.defineSlot(Node n,
Node parent,
JSType type,
boolean inferred)
Defines a typed variable.
|
(package private) void |
TypedScopeCreator.AbstractScopeBuilder.defineSlot(Node n,
Node parent,
java.lang.String variableName,
JSType type,
boolean inferred)
Defines a symbol in the current scope.
|
private static JSType |
CheckAccessControls.dereference(JSType type)
Dereference a type, autoboxing it and filtering out null.
|
private static JSType |
CheckEventfulObjectDisposal.dereference(JSType type) |
private JSType |
CheckEventfulObjectDisposal.Traversal.dereference(JSType type)
Dereference a type, autoboxing it and filtering out null.
|
private static ObjectType |
InferJSDocInfo.dereferenceToObject(JSType type)
Dereferences the given type to an object, or returns null.
|
private void |
TypeInference.ensurePropertyDefined(Node getprop,
JSType rightType)
Defines a property if the property has not been defined yet.
|
private void |
TypeCheck.ensureTyped(NodeTraversal t,
Node n,
JSType type)
Enforces type casts, and ensures the node is typed.
|
(package private) void |
TypeValidator.expectActualObject(NodeTraversal t,
Node n,
JSType type,
java.lang.String msg)
Expect the type to be an object.
|
(package private) void |
TypeValidator.expectAnyObject(NodeTraversal t,
Node n,
JSType type,
java.lang.String msg)
Expect the type to contain an object sometimes.
|
(package private) void |
TypeValidator.expectArgumentMatchesParameter(NodeTraversal t,
Node n,
JSType argType,
JSType paramType,
Node callNode,
int ordinal)
Expect that the type of an argument matches the type of the parameter
that it's fulfilling.
|
(package private) void |
TypeValidator.expectBitwiseable(NodeTraversal t,
Node n,
JSType type,
java.lang.String msg)
Expect the type to be a valid operand to a bitwise operator.
|
(package private) boolean |
TypeValidator.expectCanAssignTo(NodeTraversal t,
Node n,
JSType rightType,
JSType leftType,
java.lang.String msg)
Expect that the first type can be assigned to a symbol of the second
type.
|
(package private) boolean |
TypeValidator.expectCanAssignToPropertyOf(NodeTraversal t,
Node n,
JSType rightType,
JSType leftType,
Node owner,
java.lang.String propName)
Expect that the first type can be assigned to a symbol of the second
type.
|
(package private) void |
TypeValidator.expectCanCast(NodeTraversal t,
Node n,
JSType castType,
JSType type)
Expect that the first type can be cast to the second type.
|
(package private) void |
TypeValidator.expectCastIsNecessary(NodeTraversal t,
Node n,
JSType castType,
JSType type)
Expect that casting type to castType is necessary.
|
(package private) void |
TypeValidator.expectIndexMatch(NodeTraversal t,
Node n,
JSType objType,
JSType indexType)
Expect that the first type can be addressed with GETELEM syntax,
and that the second type is the right type for an index into the
first type.
|
(package private) boolean |
TypeValidator.expectNotNullOrUndefined(NodeTraversal t,
Node n,
JSType type,
java.lang.String msg,
JSType expectedType)
Expect the type to be anything but the null or void type.
|
(package private) void |
TypeValidator.expectNumber(NodeTraversal t,
Node n,
JSType type,
java.lang.String msg)
Expect the type to be a number, or a type convertible to number.
|
(package private) boolean |
TypeValidator.expectObject(NodeTraversal t,
Node n,
JSType type,
java.lang.String msg)
Expect the type to be an object, or a type convertible to object.
|
(package private) void |
TypeValidator.expectString(NodeTraversal t,
Node n,
JSType type,
java.lang.String msg)
Expect the type to be a string, or a type convertible to string.
|
(package private) void |
TypeValidator.expectStringOrNumber(NodeTraversal t,
Node n,
JSType type,
java.lang.String msg)
Expect the type to be a number or string, or a type convertible to a number
or string.
|
(package private) void |
TypeValidator.expectSwitchMatchesCase(NodeTraversal t,
Node n,
JSType switchType,
JSType caseType)
Expect that the type of a switch condition matches the type of its
case condition.
|
(package private) TypedVar |
TypeValidator.expectUndeclaredVariable(java.lang.String sourceName,
CompilerInput input,
Node n,
Node parent,
TypedVar var,
java.lang.String variableName,
JSType newType)
Expect that the given variable has not been declared with a type.
|
private JSType |
TypeCheck.findObjectWithNonStringifiableKey(JSType type)
Checks whether type (or one of its component if is composed type like union or templatized
type) has Object with non-stringifiable key.
|
private static java.lang.String |
TypeValidator.formatFoundRequired(java.lang.String description,
JSType found,
JSType required)
Formats a found/required error message.
|
private static void |
NameReferenceGraphReport.generateType(java.lang.StringBuilder builder,
JSType defType)
Dump a type in a nice, readable way.
|
java.util.List<SymbolTable.Symbol> |
SymbolTable.getAllSymbolsForType(JSType type)
Gets all symbols associated with the given type.
|
private static TypeCheck.SuggestionPair |
TypeCheck.getClosestPropertySuggestion(JSType objectType,
java.lang.String propName) |
private FunctionType |
DisambiguateProperties.getConstructor(JSType type) |
private static JSType |
CheckAccessControls.getFinalParentClass(JSType type)
Returns the super class of the given type that has a constructor.
|
private JSType |
DisambiguateProperties.getInstanceFromPrototype(JSType type) |
private int |
AmbiguateProperties.getIntForType(JSType type)
Returns an integer that uniquely identifies a JSType.
|
(package private) static JSType |
TypeCheck.getObjectLitKeyTypeFromValueType(Node key,
JSType valueType) |
private JSType |
TypeInference.getPropertyType(JSType objType,
java.lang.String propName,
Node n,
FlowScope scope) |
private BitSet |
AmbiguateProperties.getRelatedTypesOnNonUnion(JSType type) |
private SymbolTable.Symbol |
SymbolTable.getSymbolForTypeHelper(JSType type,
boolean linkToCtor)
Gets all symbols associated with the given type.
|
private java.lang.Iterable<JSType> |
DisambiguateProperties.getTypeAlternatives(JSType type)
Returns the alternatives if this is a type that represents multiple
types, and null if not.
|
private static java.lang.String |
CheckAccessControls.getTypeDeprecationInfo(JSType type)
Returns the deprecation reason for the type if it is marked
as being deprecated.
|
private com.google.common.collect.ImmutableSet<JSType> |
DisambiguateProperties.getTypesToSkipForType(JSType type)
Returns a set of types that should be skipped given the given type.
|
private java.util.Set<JSType> |
DisambiguateProperties.getTypesToSkipForTypeNonUnion(JSType type) |
(package private) ObjectType |
DisambiguateProperties.getTypeWithProperty(java.lang.String field,
JSType type)
Returns the type in the chain from the given type that contains the given
field or null if it is not found anywhere.
|
private ObjectType |
DisambiguateProperties.gtwpCacheGet(java.lang.String field,
JSType type) |
private void |
DisambiguateProperties.gtwpCachePut(java.lang.String field,
JSType type,
ObjectType top) |
private static void |
TypeInference.inferPropertyTypesToMatchConstraint(JSType type,
JSType constraint)
Suppose X is an object with inferred properties.
|
void |
LinkedFlowScope.inferQualifiedSlot(Node node,
java.lang.String symbol,
JSType bottomType,
JSType inferredType,
boolean declared) |
void |
LinkedFlowScope.inferSlotType(java.lang.String symbol,
JSType type) |
(package private) FunctionTypeBuilder |
FunctionTypeBuilder.inferTemplateTypeName(JSDocInfo info,
JSType ownerType)
Infer the template type from the doc info.
|
(package private) FunctionTypeBuilder |
FunctionTypeBuilder.inferThisType(JSDocInfo info,
JSType type)
Infers the type of
this . |
private boolean |
TypeInference.isAddedAsNumber(JSType type) |
private boolean |
AmbiguateProperties.isInvalidatingType(JSType type)
Returns true if properties on this type should not be renamed.
|
private boolean |
DisambiguateProperties.isInvalidatingType(JSType type)
Returns true if a field reference on this type will invalidate all
references to that field as candidates for renaming.
|
private boolean |
InlineProperties.isInvalidatingType(JSType type)
Returns true if properties on this type should not be renamed.
|
private boolean |
PureFunctionIdentifier.FunctionAnalyzer.isLocalValueType(JSType jstype) |
private boolean |
InlineProperties.ReplaceCandidates.isMatchingType(Node n,
JSType src) |
private boolean |
TypeCheck.isObjectTypeWithNonStringifiableKey(JSType type)
Checks whether current type is Object type with non-stringifable key.
|
private static boolean |
CheckEventfulObjectDisposal.isPossiblySubtype(JSType thisType,
JSType thatType)
Determines if thisType is possibly a subtype of thatType.
|
private boolean |
TypedScopeCreator.AbstractScopeBuilder.isQualifiedNameInferred(java.lang.String qName,
Node n,
JSDocInfo info,
Node rhsValue,
JSType valueType)
Determines whether a qualified name is inferred.
|
private boolean |
TypeCheck.isStringifiable(JSType type)
Checks whether type is stringifiable.
|
private boolean |
DisambiguateProperties.FindExternProperties.isStructuralInterfacePrototype(JSType type) |
private boolean |
TypeTransformation.isTemplatizable(JSType type) |
private boolean |
DisambiguateProperties.isTypeToSkip(JSType type)
Determines whether the given type is one whose properties should not be
considered for renaming.
|
private boolean |
CheckMissingReturn.isVoidOrUnknown(JSType returnType) |
TypeMatchingStrategy.MatchResult |
TypeMatchingStrategy.match(JSType templateType,
JSType type) |
private boolean |
ConformanceRules.BannedProperty.matchesPrototype(JSType type,
JSType maybePrototype) |
private boolean |
SymbolTable.PropertyRefCollector.maybeDefineTypedReference(Node n,
java.lang.String propName,
JSType owner) |
private void |
AmbiguateProperties.ProcessProperties.maybeMarkCandidate(Node n,
JSType type)
If a property node is eligible for renaming, stashes a reference to it
and increments the property name's access count.
|
private void |
TypeInference.maybeResolveTemplatedType(JSType paramType,
JSType argType,
java.util.Map<TemplateType,JSType> resolvedTypes,
java.util.Set<JSType> seenTypes) |
private boolean |
InlineProperties.GatherCandidates.maybeStoreCandidateValue(JSType type,
java.lang.String propName,
Node value) |
private void |
TypeValidator.mismatch(Node n,
java.lang.String msg,
JSType found,
JSType required) |
private void |
TypeValidator.mismatch(NodeTraversal t,
Node n,
java.lang.String msg,
JSType found,
JSType required)
Report a type mismatch
|
private void |
TypeValidator.mismatch(NodeTraversal t,
Node n,
java.lang.String msg,
JSType found,
JSTypeNative required) |
private FlowScope |
TypeInference.narrowScope(FlowScope scope,
Node node,
JSType narrowed) |
private TypeInference.BooleanOutcomePair |
TypeInference.newBooleanOutcomePair(JSType jsType,
FlowScope flowScope) |
private static JSType |
CheckAccessControls.normalizeClassType(JSType type)
Normalize the type of a constructor, its instance, and its prototype
all down to the same type (the instance type).
|
private void |
DisambiguateProperties.FindRenameableProperties.printErrorLocations(java.util.List<java.lang.String> errors,
JSType t) |
private JSType |
DisambiguateProperties.FindRenameableProperties.processProperty(NodeTraversal t,
DisambiguateProperties.Property prop,
JSType type,
JSType relatedType)
Processes a property, adding it to the list of properties to rename.
|
private void |
TypeTransformation.putNewPropInPropertyMap(java.util.Map<java.lang.String,JSType> props,
java.lang.String newPropName,
JSType newPropValue) |
private void |
DisambiguateProperties.recordInterfaces(FunctionType constructor,
JSType relatedType,
DisambiguateProperties.Property p)
Records that this property could be referenced from any interface that
this type, or any type in its superclass chain, implements.
|
private void |
DisambiguateProperties.recordInvalidatingType(JSType type,
JSError error)
Invalidates the given type, so that no properties on it will be renamed.
|
private void |
DisambiguateProperties.recordInvalidationError(JSType t,
JSError error) |
private AmbiguateProperties.Property |
AmbiguateProperties.ProcessProperties.recordProperty(java.lang.String name,
JSType type) |
private NameReferenceGraph.Name |
NameReferenceGraphConstruction.Traversal.recordPrototypePropDefinition(Node qName,
JSType type,
Node assign) |
private NameReferenceGraph.Name |
NameReferenceGraphConstruction.Traversal.recordStaticNameDefinition(java.lang.String name,
JSType type,
Node n,
Node rValue) |
private void |
TypeValidator.recordStructuralInterfaceUses(JSType found,
JSType required) |
private void |
TypeInference.redeclareSimpleVar(FlowScope scope,
Node nameNode,
JSType varType) |
private void |
TypeValidator.registerIfMismatch(JSType found,
JSType required,
JSError error) |
private void |
TypeValidator.registerMismatch(JSType found,
JSType required,
JSError error) |
private static void |
TypeInference.resolvedTemplateType(java.util.Map<TemplateType,JSType> map,
TemplateType template,
JSType resolved) |
private JSType |
TypedCodeGenerator.restrictByUndefined(JSType type) |
(package private) boolean |
DisambiguateProperties.Property.scheduleRenaming(Node node,
JSType type)
Schedule the node to potentially be renamed.
|
(package private) void |
TypedScopeCreator.AbstractScopeBuilder.setDeferredType(Node node,
JSType type) |
void |
NameReferenceGraph.Name.setType(JSType type) |
(package private) void |
TypedVar.setType(JSType type) |
(package private) boolean |
DisambiguateProperties.Property.shouldRename(JSType type)
Returns true if this property should be renamed on this type.
|
private void |
TypeInference.updateScopeForTypeChange(FlowScope scope,
Node left,
JSType leftType,
JSType resultType)
Updates the scope according to the result of a type change, like
an assignment or a type cast.
|
(package private) static boolean |
ConformanceRules.ConformanceUtil.validateParameter(JSType argType,
JSType paramType)
Expect that the type of an argument matches the type of the parameter
that it's fulfilling.
|
private void |
TypeCheck.visitObjLitKey(NodeTraversal t,
Node key,
Node objlit,
JSType litType)
Visits an object literal field definition
key : value . |
void |
GatherExternProperties.ExtractRecordTypePropertyNames.visitOnce(JSType type) |
Modifier and Type | Method and Description |
---|---|
private void |
TypeTransformation.addNewPropsFromRecordType(java.util.Map<java.lang.String,JSType> props,
RecordType recType) |
private java.util.Map<java.lang.String,JSType> |
TypeInference.buildTypeVariables(java.util.Map<TemplateType,JSType> inferredTypes)
Build the type environment where type transformations will be evaluated.
|
void |
LinkedFlowScope.completeScope(StaticTypedScope<JSType> staticScope)
Look through the given scope, and try to find slots where it doesn't
have enough type information.
|
private JSType |
TypeTransformation.createRecordType(com.google.common.collect.ImmutableMap<java.lang.String,JSType> props) |
void |
CodingConvention.defineDelegateProxyPrototypeProperties(JSTypeRegistry registry,
StaticTypedScope<JSType> scope,
java.util.List<ObjectType> delegateProxyPrototypes,
java.util.Map<java.lang.String,java.lang.String> delegateCallingConventions)
Defines the delegate proxy prototype properties.
|
void |
CodingConventions.Proxy.defineDelegateProxyPrototypeProperties(JSTypeRegistry registry,
StaticTypedScope<JSType> scope,
java.util.List<ObjectType> delegateProxyPrototypes,
java.util.Map<java.lang.String,java.lang.String> delegateCallingConventions) |
void |
CodingConventions.DefaultCodingConvention.defineDelegateProxyPrototypeProperties(JSTypeRegistry registry,
StaticTypedScope<JSType> scope,
java.util.List<ObjectType> delegateProxyPrototypes,
java.util.Map<java.lang.String,java.lang.String> delegateCallingConventions) |
private static boolean |
LinkedFlowScope.diffSlots(StaticTypedSlot<JSType> slotA,
StaticTypedSlot<JSType> slotB)
Determines whether two slots are meaningfully different for the
purposes of data flow analysis.
|
private static boolean |
LinkedFlowScope.diffSlots(StaticTypedSlot<JSType> slotA,
StaticTypedSlot<JSType> slotB)
Determines whether two slots are meaningfully different for the
purposes of data flow analysis.
|
(package private) JSType |
TypeTransformation.eval(Node ttlAst,
com.google.common.collect.ImmutableMap<java.lang.String,JSType> typeVars)
Evaluates the type transformation expression and returns the resulting
type.
|
(package private) JSType |
TypeTransformation.eval(Node ttlAst,
com.google.common.collect.ImmutableMap<java.lang.String,JSType> typeVars,
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> nameVars)
Evaluates the type transformation expression and returns the resulting
type.
|
private java.util.Map<TemplateType,JSType> |
TypeInference.evaluateTypeTransformations(com.google.common.collect.ImmutableList<TemplateType> templateTypes,
java.util.Map<TemplateType,JSType> inferredTypes)
This function will evaluate the type transformations associated to the
template types
|
private StaticTypedScope<JSType> |
TypeTransformation.getScope(StaticTypedScope<JSType> scope,
java.lang.String name) |
private void |
TypeInference.maybeResolveTemplatedType(JSType paramType,
JSType argType,
java.util.Map<TemplateType,JSType> resolvedTypes,
java.util.Set<JSType> seenTypes) |
private void |
TypeInference.maybeResolveTemplatedType(JSType paramType,
JSType argType,
java.util.Map<TemplateType,JSType> resolvedTypes,
java.util.Set<JSType> seenTypes) |
private void |
TypeInference.maybeResolveTemplateTypeFromNodes(java.lang.Iterable<Node> declParams,
java.lang.Iterable<Node> callParams,
java.util.Map<TemplateType,JSType> resolvedTypes,
java.util.Set<JSType> seenTypes) |
private void |
TypeInference.maybeResolveTemplateTypeFromNodes(java.lang.Iterable<Node> declParams,
java.lang.Iterable<Node> callParams,
java.util.Map<TemplateType,JSType> resolvedTypes,
java.util.Set<JSType> seenTypes) |
private void |
TypeInference.maybeResolveTemplateTypeFromNodes(java.util.Iterator<Node> declParams,
java.util.Iterator<Node> callParams,
java.util.Map<TemplateType,JSType> resolvedTypes,
java.util.Set<JSType> seenTypes) |
private void |
TypeInference.maybeResolveTemplateTypeFromNodes(java.util.Iterator<Node> declParams,
java.util.Iterator<Node> callParams,
java.util.Map<TemplateType,JSType> resolvedTypes,
java.util.Set<JSType> seenTypes) |
private void |
TypeTransformation.putNewPropInPropertyMap(java.util.Map<java.lang.String,JSType> props,
java.lang.String newPropName,
JSType newPropValue) |
private static void |
TypeInference.resolvedTemplateType(java.util.Map<TemplateType,JSType> map,
TemplateType template,
JSType resolved) |
Constructor and Description |
---|
DeferredSetType(Node node,
JSType type) |
LinkedFlowSlot(java.lang.String name,
JSType type,
LinkedFlowScope.LinkedFlowSlot parent) |
PropertyInfo(JSType type,
Node value) |
Symbol(java.lang.String name,
JSType type,
boolean inferred,
SymbolTable.SymbolScope scope) |
SymbolScope(Node rootNode,
SymbolTable.SymbolScope parent,
JSType typeOfThis,
SymbolTable.Symbol mySymbol) |
TypedVar(boolean inferred,
java.lang.String name,
Node nameNode,
JSType type,
TypedScope scope,
int index,
CompilerInput input) |
TypeMismatch(JSType a,
JSType b,
JSError src)
It's the responsibility of the class that creates the
TypeMismatch to ensure that a and b are
non-matching types. |
Constructor and Description |
---|
NameResolver(com.google.common.collect.ImmutableMap<java.lang.String,JSType> typeVars,
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> nameVars) |
TemplateTypeReplacer(JSTypeRegistry registry,
java.util.Map<TemplateType,JSType> replacements) |
TypeTransformation(AbstractCompiler compiler,
StaticTypedScope<JSType> scope) |
Modifier and Type | Method and Description |
---|---|
private boolean |
CheckForInOverArray.containsArray(JSType type) |
private boolean |
CheckForInOverArray.isArray(JSType type) |
Modifier and Type | Field and Description |
---|---|
private JSType |
ClosureReverseAbstractInterpreter.TypeRestriction.type |
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,com.google.common.base.Function<ClosureReverseAbstractInterpreter.TypeRestriction,JSType>> |
ClosureReverseAbstractInterpreter.restricters
Functions used to restrict types.
|
private Visitor<JSType> |
ChainableReverseAbstractInterpreter.restrictNullVisitor |
(package private) Visitor<JSType> |
ChainableReverseAbstractInterpreter.restrictToArrayVisitor
For when
goog.isArray or Array.isArray returns true. |
(package private) Visitor<JSType> |
ChainableReverseAbstractInterpreter.restrictToNotArrayVisitor
For when
goog.isArray or Array.isArray returns false. |
private Visitor<JSType> |
ClosureReverseAbstractInterpreter.restrictToNotObjectVisitor
For when
goog.isObject returns false. |
private Visitor<JSType> |
ClosureReverseAbstractInterpreter.restrictToObjectVisitor
For when
goog.isObject returns true. |
private Visitor<JSType> |
ChainableReverseAbstractInterpreter.restrictUndefinedVisitor |
Modifier and Type | Method and Description |
---|---|
private JSType |
SemanticReverseAbstractInterpreter.RestrictByTrueInstanceOfResultVisitor.applyCommonRestriction(JSType type) |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor.caseAllType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTrueTypeOfResultVisitor.caseBooleanType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByFalseTypeOfResultVisitor.caseBooleanType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByOneTypeOfResultVisitor.caseBooleanType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor.caseEnumElementType(EnumElementType enumElementType) |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTrueTypeOfResultVisitor.caseFunctionType(FunctionType type) |
JSType |
ChainableReverseAbstractInterpreter.RestrictByFalseTypeOfResultVisitor.caseFunctionType(FunctionType type) |
JSType |
ChainableReverseAbstractInterpreter.RestrictByOneTypeOfResultVisitor.caseFunctionType(FunctionType type) |
JSType |
SemanticReverseAbstractInterpreter.RestrictByTrueInstanceOfResultVisitor.caseFunctionType(FunctionType type) |
JSType |
SemanticReverseAbstractInterpreter.RestrictByFalseInstanceOfResultVisitor.caseFunctionType(FunctionType type) |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor.caseNamedType(NamedType type) |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTrueTypeOfResultVisitor.caseNoObjectType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByFalseTypeOfResultVisitor.caseNoObjectType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByOneTypeOfResultVisitor.caseNoObjectType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor.caseNoType(NoType type) |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTrueTypeOfResultVisitor.caseNullType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByFalseTypeOfResultVisitor.caseNullType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByOneTypeOfResultVisitor.caseNullType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTrueTypeOfResultVisitor.caseNumberType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByFalseTypeOfResultVisitor.caseNumberType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByOneTypeOfResultVisitor.caseNumberType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTrueTypeOfResultVisitor.caseObjectType(ObjectType type) |
JSType |
ChainableReverseAbstractInterpreter.RestrictByFalseTypeOfResultVisitor.caseObjectType(ObjectType type) |
JSType |
ChainableReverseAbstractInterpreter.RestrictByOneTypeOfResultVisitor.caseObjectType(ObjectType type) |
JSType |
SemanticReverseAbstractInterpreter.RestrictByTrueInstanceOfResultVisitor.caseObjectType(ObjectType type) |
JSType |
SemanticReverseAbstractInterpreter.RestrictByFalseInstanceOfResultVisitor.caseObjectType(ObjectType type) |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor.caseProxyObjectType(ProxyObjectType type) |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTrueTypeOfResultVisitor.caseStringType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByFalseTypeOfResultVisitor.caseStringType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByOneTypeOfResultVisitor.caseStringType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor.caseTemplateType(TemplateType templateType) |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor.caseTemplatizedType(TemplatizedType type) |
protected abstract JSType |
ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor.caseTopType(JSType topType)
Abstracts away the similarities between visiting the unknown type and the
all type.
|
protected JSType |
ChainableReverseAbstractInterpreter.RestrictByFalseTypeOfResultVisitor.caseTopType(JSType topType) |
protected JSType |
ChainableReverseAbstractInterpreter.RestrictByOneTypeOfResultVisitor.caseTopType(JSType topType) |
protected JSType |
SemanticReverseAbstractInterpreter.RestrictByTrueInstanceOfResultVisitor.caseTopType(JSType type) |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor.caseUnionType(UnionType type) |
JSType |
SemanticReverseAbstractInterpreter.RestrictByTrueInstanceOfResultVisitor.caseUnionType(UnionType type) |
JSType |
SemanticReverseAbstractInterpreter.RestrictByFalseInstanceOfResultVisitor.caseUnionType(UnionType type) |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor.caseUnknownType() |
JSType |
SemanticReverseAbstractInterpreter.RestrictByTrueInstanceOfResultVisitor.caseUnknownType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByTrueTypeOfResultVisitor.caseVoidType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByFalseTypeOfResultVisitor.caseVoidType() |
JSType |
ChainableReverseAbstractInterpreter.RestrictByOneTypeOfResultVisitor.caseVoidType() |
(package private) JSType |
ChainableReverseAbstractInterpreter.getNativeType(JSTypeNative typeId) |
private JSType |
ChainableReverseAbstractInterpreter.getNativeTypeForTypeOf(java.lang.String value)
If we definitely know what a type is based on the typeof result,
return it.
|
(package private) JSType |
ChainableReverseAbstractInterpreter.getRestrictedByTypeOfResult(JSType type,
java.lang.String value,
boolean resultEqualsValue)
Returns a version of
type that is restricted by some knowledge
about the result of the typeof operation. |
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 |
---|---|
StaticTypedSlot<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 |
---|---|
private JSType |
SemanticReverseAbstractInterpreter.RestrictByTrueInstanceOfResultVisitor.applyCommonRestriction(JSType type) |
protected abstract JSType |
ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor.caseTopType(JSType topType)
Abstracts away the similarities between visiting the unknown type and the
all type.
|
protected JSType |
ChainableReverseAbstractInterpreter.RestrictByFalseTypeOfResultVisitor.caseTopType(JSType topType) |
protected JSType |
ChainableReverseAbstractInterpreter.RestrictByOneTypeOfResultVisitor.caseTopType(JSType topType) |
protected JSType |
SemanticReverseAbstractInterpreter.RestrictByTrueInstanceOfResultVisitor.caseTopType(JSType type) |
private FlowScope |
SemanticReverseAbstractInterpreter.caseTypeOf(Node node,
JSType type,
java.lang.String value,
boolean resultEqualsValue,
FlowScope blindScope) |
protected void |
ChainableReverseAbstractInterpreter.declareNameInScope(FlowScope scope,
Node node,
JSType type)
Declares a refined type in
scope for the name represented by
node . |
(package private) JSType |
ChainableReverseAbstractInterpreter.getRestrictedByTypeOfResult(JSType type,
java.lang.String value,
boolean resultEqualsValue)
Returns a version of
type that is restricted by some knowledge
about the result of the typeof operation. |
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,
java.lang.String symbol,
JSType bottomType,
JSType inferredType,
boolean declare)
Infer the type of a qualified name.
|
void |
FlowScope.inferSlotType(java.lang.String symbol,
JSType type)
Defines the type of a symbol at this point in the flow.
|
private FlowScope |
SemanticReverseAbstractInterpreter.maybeRestrictName(FlowScope blindScope,
Node node,
JSType originalType,
JSType restrictedType)
If the restrictedType differs from the originalType, then we should
branch the current flow scope and create a new flow scope with the name
declared with the new type.
|
private FlowScope |
SemanticReverseAbstractInterpreter.maybeRestrictTwoNames(FlowScope blindScope,
Node left,
JSType originalLeftType,
JSType restrictedLeftType,
Node right,
JSType originalRightType,
JSType restrictedRightType) |
private FlowScope |
ClosureReverseAbstractInterpreter.restrictParameter(Node parameter,
JSType type,
FlowScope blindScope,
com.google.common.base.Function<ClosureReverseAbstractInterpreter.TypeRestriction,JSType> restriction,
boolean outcome) |
Modifier and Type | Method and Description |
---|---|
void |
FlowScope.completeScope(StaticTypedScope<JSType> scope)
Look through the given scope, and try to find slots where it doesn't
have enough type information.
|
private FlowScope |
ClosureReverseAbstractInterpreter.restrictParameter(Node parameter,
JSType type,
FlowScope blindScope,
com.google.common.base.Function<ClosureReverseAbstractInterpreter.TypeRestriction,JSType> restriction,
boolean outcome) |
Constructor and Description |
---|
TypeRestriction(JSType type,
boolean outcome) |
Modifier and Type | Method and Description |
---|---|
private static JSType |
Matchers.getJsType(NodeMetadata metadata,
JSTypeNative nativeType) |
private static JSType |
Matchers.getJsType(NodeMetadata metadata,
java.lang.String type) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
Matchers.areTypesEquivalentIgnoringGenerics(JSType a,
JSType b) |
Modifier and Type | Method and Description |
---|---|
JSType |
JSTypeExpression.evaluate(StaticTypedScope<JSType> scope,
TypeIRegistry 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.
|
Modifier and Type | Method and Description |
---|---|
void |
Node.setJSType(JSType jsType) |
Modifier and Type | Method and Description |
---|---|
JSType |
JSTypeExpression.evaluate(StaticTypedScope<JSType> scope,
TypeIRegistry registry)
Evaluates the type expression into a
JSType object. |
Modifier and Type | Class and Description |
---|---|
class |
SimpleReference<T extends StaticTypedSlot<JSType>>
A simple immutable reference.
|
Modifier and Type | Class and Description |
---|---|
class |
AllType
All type, representing all values.
|
(package private) class |
ArrowType
The arrow type is an internal type that models the functional arrow type
seen in typical functional programming languages.
|
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.
|
(package private) class |
ErrorFunctionType
This type is for built-in error constructors.
|
class |
FunctionType
This derived type provides extended information about a function, including
its return type and argument types.
|
(package private) class |
InstanceObjectType
An object type that is an instance of some function constructor.
|
class |
NamedType
A
NamedType is a named reference to some other type. |
(package private) class |
NamespaceType
A namespace type is a reference to a particular object.
|
class |
NoObjectType
The bottom Object type, representing the subclass of all objects.
|
(package private) 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. |
(package private) class |
ValueType
Value types (null, void, number, boolean, string).
|
class |
VoidType
Void type whose only element is the
undefined value. |
Modifier and Type | Field and Description |
---|---|
private JSType[] |
JSTypeRegistry.nativeTypes |
private JSType |
EnumElementType.primitiveType
The primitive type this enum element type wraps.
|
private JSType |
ProxyObjectType.referencedType |
private JSType |
JSType.resolveResult |
private JSType |
UnionTypeBuilder.result |
(package private) JSType |
ArrowType.returnType |
private JSType |
FunctionBuilder.returnType |
private JSType |
NamedType.PropertyContinuation.type |
private JSType |
Property.type
Property's type.
|
private JSType |
RecordTypeBuilder.RecordProperty.type |
(package private) JSType |
SimpleSlot.type |
JSType |
JSType.TypePair.typeA |
JSType |
JSType.TypePair.typeB |
private JSType |
FunctionBuilder.typeOfThis |
private JSType |
FunctionType.typeOfThis
The type of
this in the scope of this function. |
Modifier and Type | Field and Description |
---|---|
(package private) static java.util.Comparator<JSType> |
JSType.ALPHA
Total ordering on types based on their textual representation.
|
(package private) java.util.Collection<JSType> |
UnionType.alternates |
private java.util.List<JSType> |
UnionTypeBuilder.alternates |
(package private) java.util.Collection<JSType> |
UnionType.alternatesWithoutStucturalTyping |
private java.util.Map<java.lang.String,JSType> |
JSTypeRegistry.greatestSubtypeByProperty |
private java.util.IdentityHashMap<JSType,java.util.IdentityHashMap<JSType,JSType.MatchStatus>> |
JSType.EqCache.matchCache |
private java.util.IdentityHashMap<JSType,java.util.IdentityHashMap<JSType,JSType.MatchStatus>> |
JSType.EqCache.matchCache |
private com.google.common.collect.HashBasedTable<JSType,JSType,JSType.MatchStatus> |
JSType.ImplCache.matchCache |
private com.google.common.collect.HashBasedTable<JSType,JSType,JSType.MatchStatus> |
JSType.ImplCache.matchCache |
private java.util.Map<java.lang.String,JSType> |
JSTypeRegistry.namesToTypes |
private com.google.common.collect.Multimap<StaticTypedScope<JSType>,NamedType> |
JSTypeRegistry.resolvedNamedTypes |
private com.google.common.collect.ImmutableList<JSType> |
TemplateTypeMap.resolvedTemplateValues |
private java.util.Set<JSType> |
ModificationVisitor.seenTypes |
(package private) com.google.common.collect.ImmutableList<JSType> |
TemplatizedType.templateTypes |
private com.google.common.collect.ImmutableList<JSType> |
TemplateTypeMap.templateValues |
private com.google.common.collect.Multimap<StaticTypedScope<JSType>,NamedType> |
JSTypeRegistry.unresolvedNamedTypes |
private com.google.common.base.Predicate<JSType> |
NamedType.validator
Validates the type resolution.
|
Modifier and Type | Method and Description |
---|---|
JSType |
JSType.autobox()
Dereference a type for property access.
|
JSType |
UnionType.autobox() |
JSType |
BooleanType.autoboxesTo() |
JSType |
EnumElementType.autoboxesTo() |
JSType |
JSType.autoboxesTo()
Turn a scalar type to the corresponding object type.
|
JSType |
NumberType.autoboxesTo() |
JSType |
StringType.autoboxesTo() |
JSType |
RecordTypeBuilder.build()
Creates a record.
|
JSType |
UnionTypeBuilder.build()
Creates a union.
|
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 |
ModificationVisitor.caseTemplateType(TemplateType type) |
JSType |
TemplateTypeMapReplacer.caseTemplateType(TemplateType type) |
JSType |
ModificationVisitor.caseTemplatizedType(TemplatizedType type) |
JSType |
ModificationVisitor.caseUnionType(UnionType type) |
JSType |
ModificationVisitor.caseUnknownType() |
JSType |
ModificationVisitor.caseVoidType() |
private JSType |
ModificationVisitor.coerseToThisType(JSType type) |
JSType |
JSType.collapseUnion()
Gets the least supertype of this that's not a union.
|
JSType |
ProxyObjectType.collapseUnion() |
JSType |
UnionType.collapseUnion() |
JSType |
JSTypeRegistry.createDefaultObjectUnion(JSType type)
Creates a type representing nullable values of the given type.
|
private JSType |
JSTypeRegistry.createFromTypeNodesInternal(Node n,
java.lang.String sourceName,
StaticTypedScope<JSType> scope) |
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.
|
private JSType |
JSTypeRegistry.createRecordTypeFromNodes(Node n,
java.lang.String sourceName,
StaticTypedScope<JSType> scope)
Creates a RecordType from the nodes representing said record type.
|
JSType |
JSTypeRegistry.createTypeFromCommentNode(Node n,
java.lang.String sourceName,
StaticTypedScope<? extends TypeI> 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.
|
(package private) static JSType |
JSType.filterNoResolvedType(JSType type)
When computing infima, we may get a situation like
inf(Type1, Type2)
where both types are unresolved, so they're technically
subtypes of one another.
|
JSType |
EnumElementType.findPropertyType(java.lang.String propertyName) |
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.
|
JSType |
ObjectType.findPropertyType(java.lang.String propertyName) |
JSType |
ProxyObjectType.findPropertyType(java.lang.String propertyName) |
JSType |
UnionType.findPropertyType(java.lang.String propertyName) |
JSType |
ArrowType.getGreatestSubtype(JSType that) |
JSType |
JSType.getGreatestSubtype(JSType that)
Gets the greatest subtype of
this and that . |
(package private) static JSType |
JSType.getGreatestSubtype(JSType thisType,
JSType thatType)
A generic implementation meant to be used as a helper for common
getGreatestSubtype implementations.
|
(package private) JSType |
RecordType.getGreatestSubtypeHelper(JSType that) |
(package private) JSType |
TemplatizedType.getGreatestSubtypeHelper(JSType rawThat)
Computes the greatest subtype of two related templatized types.
|
JSType |
JSTypeRegistry.getGreatestSubtypeWithProperty(JSType type,
java.lang.String propertyName)
Gets the greatest subtype of the
type that has a property
propertyName defined on it. |
private JSType |
JSTypeRegistry.getJSTypeOrUnknown(Node n) |
JSType |
ArrowType.getLeastSupertype(JSType that) |
JSType |
JSType.getLeastSupertype(JSType that)
Gets the least supertype of
this and that . |
JSType |
UnionType.getLeastSupertype(JSType that) |
(package private) static JSType |
JSType.getLeastSupertype(JSType thisType,
JSType thatType)
A generic implementation meant to be used as a helper for common
getLeastSupertype implementations.
|
(package private) JSType |
JSType.getNativeType(JSTypeNative typeId)
Utility method for less verbose code.
|
JSType |
JSTypeRegistry.getNativeType(JSTypeNative typeId) |
private JSType |
ModificationVisitor.getNativeType(JSTypeNative nativeType) |
private JSType |
UnionTypeBuilder.getNativeWildcardType()
Returns ALL_TYPE, UNKNOWN_TYPE, or CHECKED_UNKNOWN_TYPE, as specified by the flags, or null
|
JSType |
EnumElementType.getPrimitiveType()
Gets the primitive type of this enum element.
|
JSType |
FunctionType.getPropertyType(java.lang.String name) |
JSType |
ObjectType.getPropertyType(java.lang.String propertyName)
Gets the property type of the property whose name is given.
|
JSType |
TemplatizedType.getPropertyType(java.lang.String propertyName) |
JSType |
NamedType.getReferencedType()
Returns the type to which this refers (which is unknown if unresolved).
|
(package private) JSType |
ProxyObjectType.getReferencedTypeInternal() |
JSType |
TemplateTypeMap.getResolvedTemplateType(TemplateType key)
Returns the JSType value associated with the specified template key.
|
JSType |
JSType.getRestrictedTypeGivenToBooleanOutcome(boolean outcome)
Computes the restricted type of this type knowing that the
ToBoolean predicate has a specific value. |
JSType |
UnionType.getRestrictedTypeGivenToBooleanOutcome(boolean 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 |
Property.getType() |
JSType |
RecordTypeBuilder.RecordProperty.getType() |
JSType |
SimpleSlot.getType() |
JSType |
JSTypeRegistry.getType(StaticTypedScope<JSType> scope,
java.lang.String jsTypeName,
java.lang.String sourceName,
int lineno,
int charno)
Looks up a type by name.
|
JSType |
JSTypeRegistry.getType(java.lang.String jsTypeName)
Looks up a type by name.
|
private JSType |
NamedType.getTypedefType(ErrorReporter t,
StaticTypedSlot<JSType> slot) |
JSType |
FunctionType.getTypeOfThis()
Gets the type of
this in this function. |
JSType |
ObjectType.getTypeOfThis() |
JSType |
ProxyObjectType.getTypeOfThis() |
(package private) JSType |
TemplateTypeMap.getUnresolvedOriginalTemplateType(TemplateType key) |
private JSType |
NamedType.lookupViaProperties(ErrorReporter reporter,
StaticTypedScope<JSType> enclosing)
Resolves a type by looking up its first component in the scope, and
subsequent components as properties.
|
(package private) JSType |
EnumElementType.meet(JSType that)
Returns the infimum of a enum element type and another type, or null
if the infimum is empty.
|
(package private) JSType |
UnionType.meet(JSType that) |
private JSType |
UnionTypeBuilder.reduceAlternatesWithoutUnion()
Reduce the alternates into a non-union type.
|
JSType |
JSType.resolve(ErrorReporter t,
StaticTypedScope<JSType> scope)
Resolve this type in the given scope.
|
(package private) JSType |
AllType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
ArrowType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
EnumElementType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
EnumType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
FunctionType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) abstract JSType |
JSType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
NamedType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> enclosing)
Resolve the referenced type within the enclosing scope.
|
(package private) JSType |
NamespaceType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> enclosing)
Resolve the referenced type within the enclosing scope.
|
(package private) JSType |
NoObjectType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
PrototypeObjectType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
ProxyObjectType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
UnionType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
UnknownType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
ValueType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
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.restrictByNotNullOrUndefined() |
(package private) static JSType |
JSType.safeResolve(JSType type,
ErrorReporter t,
StaticTypedScope<JSType> scope)
A null-safe resolve.
|
JSType |
JSType.unboxesTo()
Turn an object type to its corresponding scalar type.
|
JSType |
PrototypeObjectType.unboxesTo() |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<JSType> |
UnionType.getAlternates()
Gets the alternate types of this union type.
|
(package private) java.util.Collection<JSType> |
UnionTypeBuilder.getAlternates() |
java.util.Collection<JSType> |
UnionType.getAlternatesWithoutStructuralTyping()
Gets the alternate types of this union type, including structural interfaces
and implicit implementations as are distinct alternates.
|
StaticTypedRef<JSType> |
SimpleSlot.getDeclaration() |
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> |
ObjectType.getTemplateTypes()
Gets the declared default element type.
|
com.google.common.collect.ImmutableList<JSType> |
ProxyObjectType.getTemplateTypes() |
com.google.common.collect.ImmutableList<JSType> |
TemplatizedType.getTemplateTypes() |
Modifier and Type | Method and Description |
---|---|
UnionTypeBuilder |
UnionTypeBuilder.addAlternate(JSType alternate)
Adds an alternate to the union type under construction.
|
UnionTypeBuilder |
UnionTypeBuilder.addAlternate(JSType alternate,
boolean isStructural)
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.
|
private void |
JSTypeRegistry.addReferenceTypeIndexedByProperty(java.lang.String propertyName,
JSType 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.
|
private void |
FunctionType.appendOptionalArgString(java.lang.StringBuilder builder,
JSType paramType,
boolean forAnnotations)
Gets the string representation of an optional param.
|
private void |
FunctionType.appendVarArgsString(java.lang.StringBuilder builder,
JSType paramType,
boolean forAnnotations)
Gets the string representation of a var args param.
|
boolean |
JSType.canCastTo(JSType that)
Tests whether values of
this type can be safely assigned
to values of that type. |
(package private) boolean |
CanCastToVisitor.canCastToFunction(JSType thisType,
FunctionType functionType) |
(package private) boolean |
CanCastToVisitor.canCastToUnion(JSType thisType,
UnionType unionType) |
boolean |
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. |
java.lang.Boolean |
CanCastToVisitor.caseAllType(JSType thatType) |
T |
RelationshipVisitor.caseAllType(JSType thatType)
All type's case.
|
java.lang.Boolean |
CanCastToVisitor.caseEnumElementType(EnumElementType typeType,
JSType thatType) |
T |
RelationshipVisitor.caseEnumElementType(EnumElementType typeType,
JSType thatType)
Enum element type's case.
|
java.lang.Boolean |
CanCastToVisitor.caseFunctionType(FunctionType thisType,
JSType thatType) |
T |
RelationshipVisitor.caseFunctionType(FunctionType thisType,
JSType thatType)
Function type's case.
|
java.lang.Boolean |
CanCastToVisitor.caseNoObjectType(JSType thatType) |
T |
RelationshipVisitor.caseNoObjectType(JSType thatType)
Bottom Object type's case.
|
java.lang.Boolean |
CanCastToVisitor.caseNoType(JSType thatType) |
T |
RelationshipVisitor.caseNoType(JSType thatType)
Bottom type's case.
|
java.lang.Boolean |
CanCastToVisitor.caseObjectType(ObjectType thisType,
JSType thatType) |
T |
RelationshipVisitor.caseObjectType(ObjectType thisType,
JSType thatType)
Object type's case.
|
java.lang.Boolean |
CanCastToVisitor.caseTemplateType(TemplateType thisType,
JSType thatType) |
T |
RelationshipVisitor.caseTemplateType(TemplateType thisType,
JSType thatType)
Template type's case.
|
java.lang.Boolean |
CanCastToVisitor.caseTemplatizedType(TemplatizedType thisType,
JSType thatType) |
T |
RelationshipVisitor.caseTemplatizedType(TemplatizedType thisType,
JSType thatType)
Templatized type's case.
|
java.lang.Boolean |
CanCastToVisitor.caseUnionType(UnionType thisType,
JSType thatType) |
T |
RelationshipVisitor.caseUnionType(UnionType thisType,
JSType thatType)
Union type's case.
|
java.lang.Boolean |
CanCastToVisitor.caseUnknownType(JSType thisType,
JSType thatType) |
T |
RelationshipVisitor.caseUnknownType(JSType thisType,
JSType thatType)
Unknown type's case.
|
java.lang.Boolean |
CanCastToVisitor.caseValueType(ValueType thisType,
JSType thatType) |
T |
RelationshipVisitor.caseValueType(ValueType thisType,
JSType thatType)
Value type's case.
|
static ObjectType |
ObjectType.cast(JSType type)
A null-safe version of JSType#toObjectType.
|
(package private) java.lang.Boolean |
CanCastToVisitor.castCastToHelper(JSType thisType,
JSType thatType) |
(package private) JSType.MatchStatus |
JSType.EqCache.checkCache(JSType t1,
JSType t2) |
(package private) JSType.MatchStatus |
JSType.ImplCache.checkCache(JSType subType,
JSType superType) |
(package private) boolean |
JSType.checkEquivalenceHelper(JSType that,
EquivalenceMethod eqMethod)
An equivalence visitor.
|
(package private) boolean |
JSType.checkEquivalenceHelper(JSType that,
EquivalenceMethod eqMethod,
JSType.EqCache eqCache) |
private JSType |
ModificationVisitor.coerseToThisType(JSType type) |
boolean |
UnionType.contains(JSType type)
A
UnionType contains a given type (alternate) iff the member
vector contains it. |
(package private) ArrowType |
JSTypeRegistry.createArrowType(Node parametersNode,
JSType returnType)
Creates an arrow type, an abstract representation of the parameters
and return value of a function.
|
FunctionType |
JSTypeRegistry.createConstructorType(java.lang.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(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.
|
private FunctionType |
JSTypeRegistry.createNativeFunctionType(JSType returnType,
Node parameters) |
private FunctionType |
JSTypeRegistry.createNativeFunctionTypeWithVarArgs(JSType returnType,
JSType... parameterTypes)
Creates a function type.
|
private FunctionType |
JSTypeRegistry.createNativeFunctionTypeWithVarArgs(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.
|
private Node |
JSTypeRegistry.createParameters(boolean lastVarArgs,
JSType... parameterTypes)
Creates a tree hierarchy representing a typed argument list.
|
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(java.lang.String name,
JSType t)
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.
|
(package private) boolean |
EnumElementType.defineProperty(java.lang.String propertyName,
JSType type,
boolean inferred,
Node propertyNode) |
(package private) boolean |
FunctionType.defineProperty(java.lang.String name,
JSType type,
boolean inferred,
Node propertyNode) |
(package private) boolean |
InstanceObjectType.defineProperty(java.lang.String name,
JSType type,
boolean inferred,
Node propertyNode) |
(package private) boolean |
NamedType.defineProperty(java.lang.String propertyName,
JSType type,
boolean inferred,
Node propertyNode) |
(package private) boolean |
NoObjectType.defineProperty(java.lang.String propertyName,
JSType type,
boolean inferred,
Node propertyNode) |
(package private) abstract boolean |
ObjectType.defineProperty(java.lang.String propertyName,
JSType type,
boolean inferred,
Node propertyNode)
Defines a property.
|
(package private) boolean |
PrototypeObjectType.defineProperty(java.lang.String name,
JSType type,
boolean inferred,
Node propertyNode) |
(package private) boolean |
ProxyObjectType.defineProperty(java.lang.String propertyName,
JSType type,
boolean inferred,
Node propertyNode) |
(package private) boolean |
RecordType.defineProperty(java.lang.String propertyName,
JSType type,
boolean inferred,
Node propertyNode) |
(package private) boolean |
UnknownType.defineProperty(java.lang.String propertyName,
JSType type,
boolean inferred,
Node propertyNode) |
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. |
(package private) static JSType |
JSType.filterNoResolvedType(JSType type)
When computing infima, we may get a situation like
inf(Type1, Type2)
where both types are unresolved, so they're technically
subtypes of one another.
|
private java.lang.String |
FunctionType.getDebugHashCodeStringOf(JSType type) |
JSType |
ArrowType.getGreatestSubtype(JSType that) |
JSType |
JSType.getGreatestSubtype(JSType that)
Gets the greatest subtype of
this and that . |
(package private) static JSType |
JSType.getGreatestSubtype(JSType thisType,
JSType thatType)
A generic implementation meant to be used as a helper for common
getGreatestSubtype implementations.
|
(package private) JSType |
RecordType.getGreatestSubtypeHelper(JSType that) |
(package private) JSType |
TemplatizedType.getGreatestSubtypeHelper(JSType rawThat)
Computes the greatest subtype of two related templatized types.
|
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 |
ArrowType.getLeastSupertype(JSType that) |
JSType |
JSType.getLeastSupertype(JSType that)
Gets the least supertype of
this and that . |
JSType |
UnionType.getLeastSupertype(JSType that) |
(package private) static JSType |
JSType.getLeastSupertype(JSType thisType,
JSType thatType)
A generic implementation meant to be used as a helper for common
getLeastSupertype implementations.
|
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) |
private boolean |
UnionType.hasAlternate(JSType type,
EquivalenceMethod eqMethod,
JSType.EqCache eqCache) |
static boolean |
JSType.isEquivalent(JSType typeA,
JSType typeB) |
(package private) static boolean |
JSType.isExemptFromTemplateTypeInvariance(JSType type)
Determines if the specified type is exempt from standard invariant
templatized typing rules.
|
private boolean |
CanCastToVisitor.isInterface(JSType type) |
private boolean |
JSTypeRegistry.isNonNullable(JSType type) |
private boolean |
TemplateTypeMapReplacer.isRecursive(TemplateType currentType,
JSType replacementType)
Returns whether the replacement type is a templatized type which contains the current type.
|
boolean |
ArrowType.isSubtype(JSType that) |
boolean |
EnumElementType.isSubtype(JSType that) |
boolean |
EnumType.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 |
JSType.isSubtype(JSType that)
Checks whether
this is a subtype of that . |
boolean |
NoObjectType.isSubtype(JSType that) |
boolean |
NoResolvedType.isSubtype(JSType that) |
boolean |
NoType.isSubtype(JSType that) |
boolean |
PrototypeObjectType.isSubtype(JSType that) |
boolean |
ProxyObjectType.isSubtype(JSType that) |
boolean |
RecordType.isSubtype(JSType that) |
boolean |
TemplatizedType.isSubtype(JSType that) |
boolean |
UnionType.isSubtype(JSType that) |
boolean |
UnknownType.isSubtype(JSType that) |
protected boolean |
ArrowType.isSubtype(JSType other,
JSType.ImplCache implicitImplCache) |
protected boolean |
EnumElementType.isSubtype(JSType that,
JSType.ImplCache implicitImplCache) |
protected boolean |
EnumType.isSubtype(JSType that,
JSType.ImplCache implicitImplCache) |
protected boolean |
FunctionType.isSubtype(JSType that,
JSType.ImplCache implicitImplCache) |
protected boolean |
JSType.isSubtype(JSType that,
JSType.ImplCache implicitImplCache)
checking isSubtype with structural interface matching
|
protected boolean |
NoObjectType.isSubtype(JSType that,
JSType.ImplCache implicitImplCache) |
protected boolean |
NoResolvedType.isSubtype(JSType that,
JSType.ImplCache implicitImplCache) |
protected boolean |
NoType.isSubtype(JSType that,
JSType.ImplCache implicitImplCache) |
protected boolean |
PrototypeObjectType.isSubtype(JSType that,
JSType.ImplCache implicitImplCache) |
protected boolean |
ProxyObjectType.isSubtype(JSType that,
JSType.ImplCache implicitImplCache) |
protected boolean |
RecordType.isSubtype(JSType that,
JSType.ImplCache implicitImplCache) |
protected boolean |
TemplatizedType.isSubtype(JSType that,
JSType.ImplCache implicitImplCache) |
protected boolean |
UnionType.isSubtype(JSType that,
JSType.ImplCache implicitImplCache) |
protected boolean |
UnknownType.isSubtype(JSType that,
JSType.ImplCache implicitImplCache) |
private boolean |
UnionTypeBuilder.isSubtype(JSType rightType,
JSType leftType,
boolean isStructural) |
(package private) static boolean |
JSType.isSubtypeHelper(JSType thisType,
JSType thatType,
JSType.ImplCache implicitImplCache)
if implicitImplCache is null, then there will
be no structural interface matching
|
boolean |
JSType.isSubtypeWithoutStructuralTyping(JSType 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.
|
boolean |
JSTypeRegistry.isTemplatizable(JSType type)
Checks whether the input type can be templatized.
|
void |
JSType.matchConstraint(JSType constraint)
Modify this type so that it matches the specified type.
|
void |
PrototypeObjectType.matchConstraint(JSType constraint) |
void |
ProxyObjectType.matchConstraint(JSType constraint) |
void |
UnionType.matchConstraint(JSType constraint) |
(package private) JSType |
EnumElementType.meet(JSType that)
Returns the infimum of a enum element type and another type, or null
if the infimum is empty.
|
(package private) JSType |
UnionType.meet(JSType that) |
private Node |
FunctionParamBuilder.newParameter(JSType type) |
void |
JSTypeRegistry.overwriteDeclaredType(java.lang.String name,
JSType t)
Overrides a declared global type name.
|
private void |
JSTypeRegistry.register(JSType type) |
private void |
JSTypeRegistry.register(JSType type,
java.lang.String name) |
private void |
JSTypeRegistry.registerNativeType(JSTypeNative typeId,
JSType type) |
void |
JSTypeRegistry.registerPropertyOnType(java.lang.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.
|
(package private) static JSType |
JSType.safeResolve(JSType type,
ErrorReporter t,
StaticTypedScope<JSType> scope)
A null-safe resolve.
|
private void |
NamedType.setReferencedAndResolvedType(JSType type,
ErrorReporter reporter) |
(package private) void |
ProxyObjectType.setReferencedType(JSType referencedType) |
(package private) void |
JSType.setResolvedTypeInternal(JSType type) |
(package private) void |
Property.setType(JSType type) |
TernaryValue |
AllType.testForEquality(JSType that) |
TernaryValue |
ArrowType.testForEquality(JSType that) |
TernaryValue |
BooleanType.testForEquality(JSType that) |
TernaryValue |
EnumElementType.testForEquality(JSType that) |
TernaryValue |
EnumType.testForEquality(JSType that) |
TernaryValue |
JSType.testForEquality(JSType that)
Compares
this and that . |
TernaryValue |
NullType.testForEquality(JSType that) |
TernaryValue |
NumberType.testForEquality(JSType that) |
TernaryValue |
ObjectType.testForEquality(JSType that) |
TernaryValue |
ProxyObjectType.testForEquality(JSType that) |
TernaryValue |
StringType.testForEquality(JSType that) |
TernaryValue |
UnionType.testForEquality(JSType that) |
TernaryValue |
UnknownType.testForEquality(JSType that) |
TernaryValue |
VoidType.testForEquality(JSType that) |
(package private) TernaryValue |
JSType.testForEqualityHelper(JSType aType,
JSType bType) |
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).
|
(package private) void |
JSType.EqCache.updateCache(JSType t1,
JSType t2,
JSType.MatchStatus isMatch) |
(package private) void |
JSType.ImplCache.updateCache(JSType subType,
JSType superType,
JSType.MatchStatus isMatch) |
(package private) <T> T |
AllType.visit(RelationshipVisitor<T> visitor,
JSType that) |
(package private) <T> T |
ArrowType.visit(RelationshipVisitor<T> visitor,
JSType that) |
(package private) <T> T |
EnumElementType.visit(RelationshipVisitor<T> visitor,
JSType that) |
(package private) <T> T |
EnumType.visit(RelationshipVisitor<T> visitor,
JSType that) |
(package private) <T> T |
FunctionType.visit(RelationshipVisitor<T> visitor,
JSType that) |
(package private) abstract <T> T |
JSType.visit(RelationshipVisitor<T> visitor,
JSType that)
Visit the types with the given visitor.
|
(package private) <T> T |
NoObjectType.visit(RelationshipVisitor<T> visitor,
JSType that) |
(package private) <T> T |
NoType.visit(RelationshipVisitor<T> visitor,
JSType that) |
(package private) <T> T |
ObjectType.visit(RelationshipVisitor<T> visitor,
JSType that) |
(package private) <T> T |
ProxyObjectType.visit(RelationshipVisitor<T> visitor,
JSType that) |
(package private) <T> T |
TemplateType.visit(RelationshipVisitor<T> visitor,
JSType that) |
(package private) <T> T |
TemplatizedType.visit(RelationshipVisitor<T> visitor,
JSType that) |
(package private) <T> T |
UnionType.visit(RelationshipVisitor<T> visitor,
JSType that) |
(package private) <T> T |
UnknownType.visit(RelationshipVisitor<T> visitor,
JSType that) |
(package private) <T> T |
ValueType.visit(RelationshipVisitor<T> visitor,
JSType that) |
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.
|
(package private) boolean |
TemplatizedType.wrapsSameRawType(JSType that) |
Modifier and Type | Method and Description |
---|---|
(package private) TemplateTypeMap |
TemplateTypeMap.addValues(com.google.common.collect.ImmutableList<JSType> newValues)
Returns a new TemplateTypeMap whose values have been extended with the
specified list.
|
private JSType |
JSTypeRegistry.createFromTypeNodesInternal(Node n,
java.lang.String sourceName,
StaticTypedScope<JSType> scope) |
JSType |
JSTypeRegistry.createFunctionTypeWithInstanceType(ObjectType instanceType,
JSType returnType,
java.util.List<JSType> parameterTypes)
Creates a function type in which
this refers to an object instance. |
private JSType |
JSTypeRegistry.createRecordTypeFromNodes(Node n,
java.lang.String sourceName,
StaticTypedScope<JSType> scope)
Creates a RecordType from the nodes representing said record type.
|
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,
java.util.Map<TemplateType,JSType> templatizedTypes)
Creates a templatized instance of the specified type.
|
JSType |
JSTypeRegistry.getType(StaticTypedScope<JSType> scope,
java.lang.String jsTypeName,
java.lang.String sourceName,
int lineno,
int charno)
Looks up a type by name.
|
private JSType |
NamedType.getTypedefType(ErrorReporter t,
StaticTypedSlot<JSType> slot) |
private JSType |
NamedType.lookupViaProperties(ErrorReporter reporter,
StaticTypedScope<JSType> enclosing)
Resolves a type by looking up its first component in the scope, and
subsequent components as properties.
|
JSType |
JSType.resolve(ErrorReporter t,
StaticTypedScope<JSType> scope)
Resolve this type in the given scope.
|
(package private) JSType |
AllType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
ArrowType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
EnumElementType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
EnumType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
FunctionType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) abstract JSType |
JSType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
NamedType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> enclosing)
Resolve the referenced type within the enclosing scope.
|
(package private) JSType |
NamespaceType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> enclosing)
Resolve the referenced type within the enclosing scope.
|
(package private) JSType |
NoObjectType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
PrototypeObjectType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
ProxyObjectType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
UnionType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
UnknownType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
(package private) JSType |
ValueType.resolveInternal(ErrorReporter t,
StaticTypedScope<JSType> scope) |
private com.google.common.collect.ImmutableList<ObjectType> |
FunctionType.resolveTypeListHelper(com.google.common.collect.ImmutableList<ObjectType> list,
ErrorReporter t,
StaticTypedScope<JSType> scope)
Resolve each item in the list, and return a new list if any
references changed.
|
void |
JSTypeRegistry.resolveTypesInScope(StaticTypedScope<JSType> scope)
Resolve all the unresolved types in the given scope.
|
private void |
NamedType.resolveViaProperties(ErrorReporter reporter,
StaticTypedScope<JSType> enclosing)
Resolves a named type by looking up its first component in the scope, and
subsequent components as properties.
|
(package private) static JSType |
JSType.safeResolve(JSType type,
ErrorReporter t,
StaticTypedScope<JSType> scope)
A null-safe resolve.
|
boolean |
JSType.setValidator(com.google.common.base.Predicate<JSType> validator)
Certain types have constraints on them at resolution-time.
|
boolean |
NamedType.setValidator(com.google.common.base.Predicate<JSType> validator) |
boolean |
UnionType.setValidator(com.google.common.base.Predicate<JSType> validator) |
private static void |
FunctionType.updatePropertyTypeMap(FunctionType type,
java.util.Map<java.lang.String,JSType> propTypeMap,
java.util.HashSet<FunctionType> cache) |
Constructor and Description |
---|
ArrowType(JSTypeRegistry registry,
Node parameters,
JSType returnType) |
ArrowType(JSTypeRegistry registry,
Node parameters,
JSType returnType,
boolean returnTypeInferred) |
EnumElementType(JSTypeRegistry registry,
JSType elementType,
java.lang.String name,
EnumType enumType) |
EnumType(JSTypeRegistry registry,
java.lang.String name,
Node source,
JSType elementsType)
Creates an enum type.
|
FunctionType(JSTypeRegistry registry,
java.lang.String name,
Node source,
ArrowType arrowType,
JSType typeOfThis,
TemplateTypeMap templateTypeMap,
boolean isConstructor,
boolean nativeType)
Creates an instance for a function that might be a constructor.
|
Property(java.lang.String name,
JSType type,
boolean inferred,
Node propertyNode) |
PropertyContinuation(java.lang.String propertyName,
JSType type,
boolean inferred,
Node propertyNode) |
ProxyObjectType(JSTypeRegistry registry,
JSType referencedType) |
ProxyObjectType(JSTypeRegistry registry,
JSType referencedType,
TemplateTypeMap templateTypeMap) |
RecordProperty(JSType type,
Node propertyNode) |
SimpleSlot(java.lang.String name,
JSType type,
boolean inferred) |
TypePair(JSType typeA,
JSType typeB) |
Constructor and Description |
---|
TemplateTypeMap(JSTypeRegistry registry,
com.google.common.collect.ImmutableList<TemplateType> templateKeys,
com.google.common.collect.ImmutableList<JSType> templateValues) |
TemplatizedType(JSTypeRegistry registry,
ObjectType objectType,
com.google.common.collect.ImmutableList<JSType> templateTypes) |
UnionType(JSTypeRegistry registry,
java.util.Collection<JSType> alternatesWithoutStructuralTyping)
Creates a union type.
|
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 | Field and Description |
---|---|
private java.util.Map<java.lang.String,StaticTypedSlot<JSType>> |
MapBasedScope.slots |
Modifier and Type | Method and Description |
---|---|
static <T extends JSType,S extends JSType> |
Asserts.assertTypeCollectionEquals(java.lang.Iterable<T> a,
java.lang.Iterable<S> b) |
static <T extends JSType,S extends JSType> |
Asserts.assertTypeCollectionEquals(java.lang.Iterable<T> a,
java.lang.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,
StaticTypedScope<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,
java.lang.String... warnings)
Resolves a type expression, expecting the given warnings.
|
Modifier and Type | Method and Description |
---|---|
StaticTypedSlot<JSType> |
MapBasedScope.getSlot(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
private static void |
BaseJSTypeTestCase.addMethod(JSTypeRegistry registry,
ObjectType receivingType,
java.lang.String methodName,
JSType returnType) |
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) |
static void |
Asserts.assertTypeEquals(JSType a,
JSType b) |
protected void |
BaseJSTypeTestCase.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 . |
static void |
Asserts.assertTypeEquals(java.lang.String message,
JSType a,
JSType b) |
protected void |
BaseJSTypeTestCase.assertTypeEquals(java.lang.String msg,
JSType a,
JSType b) |
static void |
Asserts.assertTypeNotEquals(JSType a,
JSType b) |
protected void |
BaseJSTypeTestCase.assertTypeNotEquals(JSType a,
JSType b) |
static void |
Asserts.assertTypeNotEquals(java.lang.String message,
JSType a,
JSType b) |
protected void |
BaseJSTypeTestCase.assertTypeNotEquals(java.lang.String msg,
JSType a,
JSType b) |
static JSType |
Asserts.assertValidResolve(JSType type) |
static JSType |
Asserts.assertValidResolve(JSType type,
StaticTypedScope<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,
StaticTypedScope<JSType> scope) |
protected TemplatizedType |
BaseJSTypeTestCase.createTemplatizedType(ObjectType baseType,
com.google.common.collect.ImmutableList<JSType> templatizedTypes) |
Constructor and Description |
---|
MapBasedScope(java.util.Map<java.lang.String,? extends JSType> namesToTypes) |