Package | Description |
---|---|
com.google.javascript.jscomp |
Provides the core compiler and its public API.
|
com.google.javascript.jscomp.type |
Provides type-checking data structures and algorithms.
|
Modifier and Type | Class and Description |
---|---|
(package private) class |
LinkedFlowScope
A flow scope that tries to store as little symbol information as possible,
instead delegating to its parents.
|
Modifier and Type | Field and Description |
---|---|
private FlowScope |
TypeInference.bottomScope |
private FlowScope |
TypeInference.functionScope |
(package private) FlowScope |
TypeInference.BooleanOutcomePair.joinedScope |
(package private) FlowScope |
TypeInference.BooleanOutcomePair.leftScope |
(package private) FlowScope |
TypeInference.BooleanOutcomePair.rightScope |
Modifier and Type | Method and Description |
---|---|
FlowScope |
LinkedFlowScope.FlowScopeJoinOp.apply(FlowScope a,
FlowScope b) |
FlowScope |
LinkedFlowScope.createChildFlowScope() |
(package private) FlowScope |
TypeInference.createEntryLattice() |
(package private) FlowScope |
TypeInference.createInitialEstimateLattice() |
private FlowScope |
TypeInference.dereferencePointer(Node n,
FlowScope scope)
If we access a property of a symbol, then that symbol is not
null or undefined.
|
(package private) FlowScope |
TypeInference.flowThrough(Node n,
FlowScope input) |
(package private) FlowScope |
TypeInference.BooleanOutcomePair.getJoinedFlowScope()
Gets the safe estimated scope without knowing if all of the
subexpressions will be evaluated.
|
(package private) FlowScope |
TypeInference.BooleanOutcomePair.getOutcomeFlowScope(int nodeType,
boolean outcome)
Gets the outcome scope if we do know the outcome of the entire
expression.
|
private FlowScope |
TypeInference.narrowScope(FlowScope scope,
Node node,
JSType narrowed) |
private FlowScope |
TypeInference.tightenTypesAfterAssertions(FlowScope scope,
Node callNode) |
private FlowScope |
TypeInference.traverse(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseAdd(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseArrayLiteral(Node n,
FlowScope scope)
Traverse each element of the array.
|
private FlowScope |
TypeInference.traverseAssign(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseCall(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseCatch(Node catchNode,
FlowScope scope)
Any value can be thrown, so it's really impossible to determine the type
of a CATCH param.
|
private FlowScope |
TypeInference.traverseChildren(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseGetElem(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseGetProp(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseHook(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseName(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseNew(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseObjectLiteral(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseReturn(Node n,
FlowScope scope)
Traverse a return value.
|
Modifier and Type | Method and Description |
---|---|
(package private) java.util.List<FlowScope> |
TypeInference.branchedFlowThrough(Node source,
FlowScope input) |
Modifier and Type | Method and Description |
---|---|
FlowScope |
LinkedFlowScope.FlowScopeJoinOp.apply(FlowScope a,
FlowScope b) |
(package private) java.util.List<FlowScope> |
TypeInference.branchedFlowThrough(Node source,
FlowScope input) |
private FlowScope |
TypeInference.dereferencePointer(Node n,
FlowScope scope)
If we access a property of a symbol, then that symbol is not
null or undefined.
|
StaticTypedSlot<JSType> |
LinkedFlowScope.findUniqueRefinedSlot(FlowScope blindScope)
Iterate through all the linked flow scopes before this one.
|
(package private) FlowScope |
TypeInference.flowThrough(Node n,
FlowScope input) |
private JSType |
TypeInference.getPropertyType(JSType objType,
java.lang.String propName,
Node n,
FlowScope scope) |
private FlowScope |
TypeInference.narrowScope(FlowScope scope,
Node node,
JSType narrowed) |
private TypeInference.BooleanOutcomePair |
TypeInference.newBooleanOutcomePair(JSType jsType,
FlowScope flowScope) |
private void |
TypeInference.redeclareSimpleVar(FlowScope scope,
Node nameNode,
JSType varType) |
private FlowScope |
TypeInference.tightenTypesAfterAssertions(FlowScope scope,
Node callNode) |
private FlowScope |
TypeInference.traverse(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseAdd(Node n,
FlowScope scope) |
private TypeInference.BooleanOutcomePair |
TypeInference.traverseAnd(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseArrayLiteral(Node n,
FlowScope scope)
Traverse each element of the array.
|
private FlowScope |
TypeInference.traverseAssign(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseCall(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseCatch(Node catchNode,
FlowScope scope)
Any value can be thrown, so it's really impossible to determine the type
of a CATCH param.
|
private FlowScope |
TypeInference.traverseChildren(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseGetElem(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseGetProp(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseHook(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseName(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseNew(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseObjectLiteral(Node n,
FlowScope scope) |
private TypeInference.BooleanOutcomePair |
TypeInference.traverseOr(Node n,
FlowScope scope) |
private FlowScope |
TypeInference.traverseReturn(Node n,
FlowScope scope)
Traverse a return value.
|
private TypeInference.BooleanOutcomePair |
TypeInference.traverseShortCircuitingBinOp(Node n,
FlowScope scope) |
private TypeInference.BooleanOutcomePair |
TypeInference.traverseWithinShortCircuitingBinOp(Node n,
FlowScope scope) |
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.
|
Constructor and Description |
---|
BooleanOutcomePair(BooleanLiteralSet toBooleanOutcomes,
BooleanLiteralSet booleanValues,
FlowScope leftScope,
FlowScope rightScope) |
Modifier and Type | Method and Description |
---|---|
private FlowScope |
SemanticReverseAbstractInterpreter.caseAndOrMaybeShortCircuiting(Node left,
Node right,
FlowScope blindScope,
boolean outcome) |
private FlowScope |
SemanticReverseAbstractInterpreter.caseAndOrNotShortCircuiting(Node left,
Node right,
FlowScope blindScope,
boolean outcome) |
private FlowScope |
SemanticReverseAbstractInterpreter.caseEquality(Node condition,
FlowScope blindScope,
com.google.common.base.Function<JSType.TypePair,JSType.TypePair> merging) |
private FlowScope |
SemanticReverseAbstractInterpreter.caseEquality(Node left,
Node right,
FlowScope blindScope,
com.google.common.base.Function<JSType.TypePair,JSType.TypePair> merging) |
private FlowScope |
SemanticReverseAbstractInterpreter.caseIn(Node object,
java.lang.String propertyName,
FlowScope blindScope)
Given 'property in object', ensures that the object has the property in the
informed scope by defining it as a qualified name if the object type lacks
the property and it's not in the blind scope.
|
private FlowScope |
SemanticReverseAbstractInterpreter.caseInstanceOf(Node left,
Node right,
FlowScope blindScope,
boolean outcome) |
private FlowScope |
SemanticReverseAbstractInterpreter.caseIsArray(Node value,
FlowScope blindScope,
boolean outcome) |
private FlowScope |
SemanticReverseAbstractInterpreter.caseNameOrGetProp(Node name,
FlowScope blindScope,
boolean outcome) |
private FlowScope |
SemanticReverseAbstractInterpreter.caseTypeOf(Node node,
JSType type,
java.lang.String value,
boolean resultEqualsValue,
FlowScope blindScope) |
FlowScope |
FlowScope.createChildFlowScope()
Creates a child of this flow scope, to represent an instruction
directly following this one.
|
protected FlowScope |
ChainableReverseAbstractInterpreter.firstPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome)
Calculates the preciser scope starting with the first link.
|
FlowScope |
ClosureReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome) |
FlowScope |
ReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome)
Calculates a precise version of the scope knowing the outcome of the
condition.
|
FlowScope |
SemanticReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome) |
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) |
protected FlowScope |
ChainableReverseAbstractInterpreter.nextPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome)
Delegates the calculation of the preciser scope to the next link.
|
FlowScope |
FlowScope.optimize()
Optimize this scope and return a new FlowScope with faster lookup.
|
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 |
---|---|
private FlowScope |
SemanticReverseAbstractInterpreter.caseAndOrMaybeShortCircuiting(Node left,
Node right,
FlowScope blindScope,
boolean outcome) |
private FlowScope |
SemanticReverseAbstractInterpreter.caseAndOrNotShortCircuiting(Node left,
Node right,
FlowScope blindScope,
boolean outcome) |
private FlowScope |
SemanticReverseAbstractInterpreter.caseEquality(Node condition,
FlowScope blindScope,
com.google.common.base.Function<JSType.TypePair,JSType.TypePair> merging) |
private FlowScope |
SemanticReverseAbstractInterpreter.caseEquality(Node left,
Node right,
FlowScope blindScope,
com.google.common.base.Function<JSType.TypePair,JSType.TypePair> merging) |
private FlowScope |
SemanticReverseAbstractInterpreter.caseIn(Node object,
java.lang.String propertyName,
FlowScope blindScope)
Given 'property in object', ensures that the object has the property in the
informed scope by defining it as a qualified name if the object type lacks
the property and it's not in the blind scope.
|
private FlowScope |
SemanticReverseAbstractInterpreter.caseInstanceOf(Node left,
Node right,
FlowScope blindScope,
boolean outcome) |
private FlowScope |
SemanticReverseAbstractInterpreter.caseIsArray(Node value,
FlowScope blindScope,
boolean outcome) |
private FlowScope |
SemanticReverseAbstractInterpreter.caseNameOrGetProp(Node name,
FlowScope blindScope,
boolean outcome) |
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 . |
StaticTypedSlot<JSType> |
FlowScope.findUniqueRefinedSlot(FlowScope blindScope)
Tries to find a unique refined variable in the refined scope, up to the
the blind scope.
|
protected FlowScope |
ChainableReverseAbstractInterpreter.firstPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome)
Calculates the preciser scope starting with the first link.
|
FlowScope |
ClosureReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome) |
FlowScope |
ReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome)
Calculates a precise version of the scope knowing the outcome of the
condition.
|
FlowScope |
SemanticReverseAbstractInterpreter.getPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome) |
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.
|
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) |
protected FlowScope |
ChainableReverseAbstractInterpreter.nextPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome)
Delegates the calculation of the preciser scope to the next link.
|
private FlowScope |
ClosureReverseAbstractInterpreter.restrictParameter(Node parameter,
JSType type,
FlowScope blindScope,
com.google.common.base.Function<ClosureReverseAbstractInterpreter.TypeRestriction,JSType> restriction,
boolean outcome) |