Class CatchNode
java.lang.Object
com.oracle.js.parser.ir.Node
com.oracle.js.parser.ir.Statement
com.oracle.js.parser.ir.CatchNode
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCatchNode(int lineNumber, long token, int finish, IdentNode exception, Expression pattern, Expression exceptionCondition, Block body, boolean isSyntheticRethrow) Constructors -
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.getBody()Get the body for this catch blockGet the exception destructuring pattern for this catch blockGet the identifier representing the exception thrownGet the exception condition for this catch blockbooleanIs this catch block a non-JavaScript constructor, for example created as part of the rethrow mechanism of a finally block in Lower? Then we just pass the exception on and need not unwrap whatever is in the ECMAException object catch symbolbooleanIs this a terminal statement, i.e.setDestructuringPattern(Expression pattern) Resets the exception destructuring pattern of a catch blocksetException(IdentNode exception) Resets the exception of a catch blocksetExceptionCondition(Expression exceptionCondition) Reset the exception condition for this catch blockvoidtoString(StringBuilder sb, boolean printTypes) 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, hasTerminalFlags, isCompletionValueNeverEmptyMethods inherited from class com.oracle.js.parser.ir.Node
clone, equals, getFinish, getSourceOrder, getStart, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toString
-
Constructor Details
-
CatchNode
public CatchNode(int lineNumber, long token, int finish, IdentNode exception, Expression pattern, Expression exceptionCondition, Block body, boolean isSyntheticRethrow) Constructors- Parameters:
lineNumber- lineNumbertoken- tokenfinish- finishexception- variable name of exceptionpattern- catch parameter destructuring assignmentexceptionCondition- exception conditionbody- catch bodyisSyntheticRethrow- true if this node is a synthetically generated rethrow node.
-
-
Method Details
-
accept
Assist in IR navigation. -
accept
Description copied from class:NodeProvides a means to navigate the IR. -
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
-
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 -
getException
Get the identifier representing the exception thrown- Returns:
- the exception identifier
-
getExceptionCondition
Get the exception condition for this catch block- Returns:
- the exception condition
-
setExceptionCondition
Reset the exception condition for this catch block- Parameters:
exceptionCondition- the new exception condition- Returns:
- new or same CatchNode
-
getBody
-
setException
-
getDestructuringPattern
Get the exception destructuring pattern for this catch block- Returns:
- the destructuring pattern
-
setDestructuringPattern
Resets the exception destructuring pattern of a catch block- Parameters:
pattern- new pattern- Returns:
- new catch node if changed, same otherwise
-
isSyntheticRethrow
public boolean isSyntheticRethrow()Is this catch block a non-JavaScript constructor, for example created as part of the rethrow mechanism of a finally block in Lower? Then we just pass the exception on and need not unwrap whatever is in the ECMAException object catch symbol- Returns:
- true if a finally synthetic rethrow
-