Class JoinPredecessorExpression
java.lang.Object
com.oracle.js.parser.ir.Node
com.oracle.js.parser.ir.Expression
com.oracle.js.parser.ir.JoinPredecessorExpression
- All Implemented Interfaces:
Cloneable
A wrapper for an expression that is in a position to be a join predecessor.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionA no-arg constructor does not wrap any expression on its own, but can be used as a place to contain a local variable conversion in a place where an expression can otherwise stand.JoinPredecessorExpression(Expression expression) A constructor for wrapping an expression and making it a join predecessor. -
Method Summary
Modifier and TypeMethodDescriptionaccept(NodeVisitor<? extends LexicalContext> visitor) Provides a means to navigate the IR.<R> Raccept(TranslatorNodeVisitor<? extends LexicalContext, R> visitor) Provides a means to navigate the IR.Returns the underlying expression.booleanReturns true if the runtime value of this expression is always false when converted to boolean as per ECMAScript ToBoolean conversion.booleanReturns true if the runtime value of this expression is always true when converted to boolean as per ECMAScript ToBoolean conversion.setExpression(Expression expression) Sets the underlying expression.voidtoString(StringBuilder sb, boolean printType) Print logic that decides whether to show the optimistic type or not - for example it should not be printed after just parse, when it hasn't been computed, or has been set to a trivially provable valueMethods inherited from class Expression
getFinish, getFinishWithoutParens, getStart, getStartWithoutParens, isParenthesized, isSelfModifying, makeParenthesizedMethods inherited from class Node
clone, equals, getSourceOrder, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toString
-
Constructor Details
-
JoinPredecessorExpression
public JoinPredecessorExpression()A no-arg constructor does not wrap any expression on its own, but can be used as a place to contain a local variable conversion in a place where an expression can otherwise stand. -
JoinPredecessorExpression
A constructor for wrapping an expression and making it a join predecessor. Typically used on true and false subexpressions of the ternary node as well as on the operands of short-circuiting logical expressions&&and||.- Parameters:
expression- the expression to wrap
-
-
Method Details
-
isAlwaysFalse
public boolean isAlwaysFalse()Description copied from class:ExpressionReturns true if the runtime value of this expression is always false when converted to boolean as per ECMAScript ToBoolean conversion. Used in control flow calculations.- Overrides:
isAlwaysFalsein classExpression- Returns:
- true if this expression's runtime value converted to boolean is always false.
-
isAlwaysTrue
public boolean isAlwaysTrue()Description copied from class:ExpressionReturns true if the runtime value of this expression is always true when converted to boolean as per ECMAScript ToBoolean conversion. Used in control flow calculations.- Overrides:
isAlwaysTruein classExpression- Returns:
- true if this expression's runtime value converted to boolean is always true.
-
getExpression
Returns the underlying expression.- Returns:
- the underlying expression.
-
setExpression
Sets the underlying expression.- Parameters:
expression- the new underlying expression- Returns:
- this or modified join predecessor expression object.
-
accept
Description copied from class:NodeProvides a means to navigate the IR. -
accept
Description copied from class:NodeProvides a means to navigate the IR. -
toString
Description copied from class:NodePrint logic that decides whether to show the optimistic type or not - for example it should not be printed after just parse, when it hasn't been computed, or has been set to a trivially provable value
-