Class ThrowNode
java.lang.Object
com.oracle.js.parser.ir.Node
com.oracle.js.parser.ir.Statement
com.oracle.js.parser.ir.ThrowNode
IR representation for throw statements.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionThrowNode(int lineNumber, long token, int finish, Expression expression, boolean isSyntheticRethrow) Constructor -
Method Summary
Modifier and TypeMethodDescriptionaccept(NodeVisitor<? extends LexicalContext> visitor) Assist in IR navigation.<R> Raccept(TranslatorNodeVisitor<? extends LexicalContext, R> visitor) Provides a means to navigate the IR.Get the expression that is being thrown by this nodebooleanbooleanIs this a throw a synthetic rethrow in a synthetic catch-all block created when inlining finally statements? In that case we never wrap whatever is thrown into an ECMAException, just rethrow it.booleanIs this a terminal statement, i.e.setExpression(Expression expression) Reset the expression being thrown by this nodevoidtoString(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 Statement
getLineNumber, hasGoto, hasTerminalFlagsMethods inherited from class Node
clone, equals, getFinish, getSourceOrder, getStart, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toString
-
Constructor Details
-
ThrowNode
public ThrowNode(int lineNumber, long token, int finish, Expression expression, boolean isSyntheticRethrow) Constructor- Parameters:
lineNumber- line numbertoken- tokenfinish- finishexpression- expression to throwisSyntheticRethrow- true if this throw node is part of a synthetic rethrow.
-
-
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
Assist in IR navigation. -
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 that is being thrown by this node- Returns:
- expression
-
setExpression
Reset the expression being thrown by this node- Parameters:
expression- new expression- Returns:
- new or same thrownode
-
isSyntheticRethrow
public boolean isSyntheticRethrow()Is this a throw a synthetic rethrow in a synthetic catch-all block created when inlining finally statements? In that case we never wrap whatever is thrown into an ECMAException, just rethrow it.- Returns:
- true if synthetic throw node
-
isCompletionValueNeverEmpty
public boolean isCompletionValueNeverEmpty()- Overrides:
isCompletionValueNeverEmptyin classStatement- Returns:
- true if the completion value of this statement is never the value
empty
-