Class TryNode
java.lang.Object
com.oracle.js.parser.ir.Node
com.oracle.js.parser.ir.Statement
com.oracle.js.parser.ir.TryNode
-
Field Summary
-
Constructor Summary
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 try blockGet the catch blocks for this try blockGet the catches for this try blockGet the exception symbol for this try blockGet the body of the finally clause for this trybooleanbooleanIs this a terminal statement, i.e.Reset the body of this try blocksetCatchBlocks(List<Block> catchBlocks) Set the catch blocks of this trysetFinallyBody(Block finallyBody) Set the finally body of this tryvoidtoString(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
-
TryNode
public TryNode(int lineNumber, long token, int finish, Block body, List<Block> catchBlocks, Block finallyBody) Constructor- Parameters:
lineNumber- lineNumbertoken- tokenfinish- finishbody- try node bodycatchBlocks- list of catch blocks in orderfinallyBody- body of finally block or null if none
-
-
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 -
getBody
-
setBody
-
getCatches
-
getCatchBlocks
-
setCatchBlocks
-
getException
Get the exception symbol for this try block- Returns:
- a symbol for the compiler to store the exception in
-
getFinallyBody
Get the body of the finally clause for this try- Returns:
- finally body, or null if no finally
-
setFinallyBody
-
isCompletionValueNeverEmpty
public boolean isCompletionValueNeverEmpty()- Overrides:
isCompletionValueNeverEmptyin classStatement- Returns:
- true if the completion value of this statement is never the value
empty
-