Class ChainableReverseAbstractInterpreter

java.lang.Object
com.google.javascript.jscomp.type.ChainableReverseAbstractInterpreter
All Implemented Interfaces:
ReverseAbstractInterpreter
Direct Known Subclasses:
ClosureReverseAbstractInterpreter, SemanticReverseAbstractInterpreter

public abstract class ChainableReverseAbstractInterpreter extends Object implements ReverseAbstractInterpreter
Chainable reverse abstract interpreter providing basic functionality.
  • Field Details

  • Constructor Details

  • Method Details

    • append

      Appends a link to this, returning the updated last link.

      The pattern new X().append(new Y())...append(new Z()) forms a chain starting with X, then Y, then ... Z.

      Parameters:
      lastLink - a chainable interpreter, with no next link
      Returns:
      the updated last link
    • getFirst

      Gets the first link of this chain.
    • firstPreciserScopeKnowingConditionOutcome

      protected FlowScope firstPreciserScopeKnowingConditionOutcome(Node condition, FlowScope blindScope, boolean outcome)
      Calculates the preciser scope starting with the first link.
    • nextPreciserScopeKnowingConditionOutcome

      protected FlowScope nextPreciserScopeKnowingConditionOutcome(Node condition, FlowScope blindScope, boolean outcome)
      Delegates the calculation of the preciser scope to the next link. If there is no next link, returns the blind scope.
    • getTypeIfRefinable

      protected JSType 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.
      Returns:
      The current type of the node if it can be refined, null otherwise.
    • declareNameInScope

      protected void declareNameInScope(FlowScope scope, Node node, JSType type)
      Declares a refined type in scope for the name represented by node. It must be possible to refine the type of the given node in the given scope, as determined by getTypeIfRefinable(com.google.javascript.rhino.Node, com.google.javascript.jscomp.type.FlowScope).
    • getRestrictedWithoutUndefined

      protected final JSType getRestrictedWithoutUndefined(JSType type)
      Returns a version of type where undefined is not present.
    • getRestrictedWithoutNull

      protected final JSType getRestrictedWithoutNull(JSType type)
      Returns a version of type where null is not present.