public final class ClosureReverseAbstractInterpreter extends ChainableReverseAbstractInterpreter
goog.isDef
.Modifier and Type | Class and Description |
---|---|
private static class |
ClosureReverseAbstractInterpreter.TypeRestriction |
ChainableReverseAbstractInterpreter.RestrictByFalseTypeOfResultVisitor, ChainableReverseAbstractInterpreter.RestrictByTrueTypeOfResultVisitor, ChainableReverseAbstractInterpreter.RestrictByTypeOfResultVisitor
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,com.google.common.base.Function<ClosureReverseAbstractInterpreter.TypeRestriction,JSType>> |
restricters
Functions used to restrict types.
|
private Visitor<JSType> |
restrictToNotObjectVisitor
For when
goog.isObject returns false. |
private Visitor<JSType> |
restrictToObjectVisitor
For when
goog.isObject returns true. |
restrictToArrayVisitor, restrictToNotArrayVisitor, typeRegistry
Constructor and Description |
---|
ClosureReverseAbstractInterpreter(JSTypeRegistry typeRegistry) |
Modifier and Type | Method and Description |
---|---|
FlowScope |
getPreciserScopeKnowingConditionOutcome(Node condition,
FlowScope blindScope,
boolean outcome)
Calculates a precise version of the scope knowing the outcome of the
condition.
|
private FlowScope |
restrictParameter(Node parameter,
JSType type,
FlowScope blindScope,
com.google.common.base.Function<ClosureReverseAbstractInterpreter.TypeRestriction,JSType> restriction,
boolean outcome) |
append, declareNameInScope, firstPreciserScopeKnowingConditionOutcome, getFirst, getNativeType, getRestrictedByTypeOfResult, getRestrictedWithoutNull, getRestrictedWithoutUndefined, getTypeIfRefinable, nextPreciserScopeKnowingConditionOutcome
private final Visitor<JSType> restrictToObjectVisitor
goog.isObject
returns true. This includes functions, but
not null
.private final Visitor<JSType> restrictToNotObjectVisitor
goog.isObject
returns false.private java.util.Map<java.lang.String,com.google.common.base.Function<ClosureReverseAbstractInterpreter.TypeRestriction,JSType>> restricters
public ClosureReverseAbstractInterpreter(JSTypeRegistry typeRegistry)
public FlowScope getPreciserScopeKnowingConditionOutcome(Node condition, FlowScope blindScope, boolean outcome)
ReverseAbstractInterpreter
condition
- the condition's expressionblindScope
- the scope without knowledge about the outcome of the
conditionoutcome
- the outcome of the condition