Class ReturnNode
java.lang.Object
com.oracle.js.parser.ir.Node
com.oracle.js.parser.ir.Statement
com.oracle.js.parser.ir.ReturnNode
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionReturnNode(int lineNumber, long token, int finish, Expression expression) Constructor -
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.Get the expression this node returnsbooleanbooleanbooleanIs this a terminal statement, i.e.setExpression(Expression expression) Reset the expression this node returnsvoidsetInTerminalPosition(boolean inTerminalPosition) 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 com.oracle.js.parser.ir.Statement
getLineNumber, hasGoto, hasTerminalFlagsMethods inherited from class com.oracle.js.parser.ir.Node
clone, equals, getFinish, getSourceOrder, getStart, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toString
-
Constructor Details
-
ReturnNode
Constructor- Parameters:
lineNumber- line numbertoken- tokenfinish- finishexpression- expression to return
-
-
Method Details
-
isTerminal
public boolean isTerminal()Description copied from class:StatementIs this a terminal statement, i.e. does it end control flow like a throw or return?- Specified by:
isTerminalin interfaceTerminal- Overrides:
isTerminalin classStatement- Returns:
- true if this node statement is terminal
-
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 -
getExpression
Get the expression this node returns- Returns:
- return expression, or null if void return
-
setExpression
Reset the expression this node returns- Parameters:
expression- new expression, or null if void return- Returns:
- new or same return node
-
isInTerminalPosition
public boolean isInTerminalPosition() -
setInTerminalPosition
public void setInTerminalPosition(boolean inTerminalPosition) -
isCompletionValueNeverEmpty
public boolean isCompletionValueNeverEmpty()- Overrides:
isCompletionValueNeverEmptyin classStatement- Returns:
- true if the completion value of this statement is never the value
empty
-