public final class OptionalChainNode extends JavaScriptNode
| Modifier and Type | Class and Description |
|---|---|
static class |
OptionalChainNode.OptionalTargetableNode |
static class |
OptionalChainNode.ShortCircuitNode
Evaluates an optional expression and if its value is null or undefined, jumps out of the
short-circuiting expression to the parent
OptionalChainNode. |
static class |
OptionalChainNode.ShortCircuitTargetableNode
Evaluates an optional expression and if its value is null or undefined, jumps out of the
short-circuiting expression to the parent
OptionalChainNode. |
INTERMEDIATE_VALUE| Modifier | Constructor and Description |
|---|---|
protected |
OptionalChainNode(JavaScriptNode chainNode,
Object result) |
| Modifier and Type | Method and Description |
|---|---|
protected JavaScriptNode |
copyUninitialized(Set<Class<? extends com.oracle.truffle.api.instrumentation.Tag>> materializedTags) |
static JavaScriptNode |
createShortCircuit(JavaScriptNode expressionNode) |
static JavaScriptNode |
createTarget(JavaScriptNode chainNode) |
Object |
execute(com.oracle.truffle.api.frame.VirtualFrame frame)
Executes this node using the specified context and frame and returns the result value.
|
double |
executeDouble(com.oracle.truffle.api.frame.VirtualFrame frame)
Like
JavaScriptNode.execute(VirtualFrame) except that it tries to convert the result value to a
double. |
int |
executeInt(com.oracle.truffle.api.frame.VirtualFrame frame)
Like
JavaScriptNode.execute(VirtualFrame) except that it tries to convert the result value to an
int. |
void |
executeVoid(com.oracle.truffle.api.frame.VirtualFrame frame)
Like
JavaScriptNode.execute(VirtualFrame) except that it throws away the result. |
JavaScriptNode |
getAccessNode() |
addCallTag, addExpressionTag, addRootBodyTag, addStatementTag, cloneUninitialized, cloneUninitialized, copy, createWrapper, executeBoolean, executeLong, expressionToString, findBlockScopeNode, getSourceSection, hasSourceSection, hasTag, isInstrumentable, isResultAlwaysOfType, onReplace, removeSourceSection, setSourceSection, setSourceSection, toString, transferSourceSection, transferSourceSectionAddExpressionTag, transferSourceSectionAndTagsgetLanguage, getRealm, hasOverloadedOperatorsaccept, adoptChildren, atomic, atomic, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, replace, replace, reportPolymorphicSpecializeprotected OptionalChainNode(JavaScriptNode chainNode, Object result)
public static JavaScriptNode createTarget(JavaScriptNode chainNode)
public static JavaScriptNode createShortCircuit(JavaScriptNode expressionNode)
public Object execute(com.oracle.truffle.api.frame.VirtualFrame frame)
JavaScriptNodeexecute in class JavaScriptNodeframe - the frame of the currently executing guest language methodpublic void executeVoid(com.oracle.truffle.api.frame.VirtualFrame frame)
JavaScriptNodeJavaScriptNode.execute(VirtualFrame) except that it throws away the result. A node can
override this method if it has a better way to execute without producing a value.executeVoid in class JavaScriptNodeframe - the frame of the currently executing guest language methodpublic int executeInt(com.oracle.truffle.api.frame.VirtualFrame frame)
throws com.oracle.truffle.api.nodes.UnexpectedResultException
JavaScriptNodeJavaScriptNode.execute(VirtualFrame) except that it tries to convert the result value to an
int. A node can override this method if it has a better way to producing a value of type int.executeInt in class JavaScriptNodeframe - the frame of the currently executing guest language methodcom.oracle.truffle.api.nodes.UnexpectedResultException - if a loss-free conversion of the result to int is not
possiblepublic double executeDouble(com.oracle.truffle.api.frame.VirtualFrame frame)
throws com.oracle.truffle.api.nodes.UnexpectedResultException
JavaScriptNodeJavaScriptNode.execute(VirtualFrame) except that it tries to convert the result value to a
double. A node can override this method if it has a better way to producing a value of type
double.executeDouble in class JavaScriptNodeframe - the frame of the currently executing guest language methodcom.oracle.truffle.api.nodes.UnexpectedResultException - if a loss-free conversion of the result to double is not
possibleprotected JavaScriptNode copyUninitialized(Set<Class<? extends com.oracle.truffle.api.instrumentation.Tag>> materializedTags)
copyUninitialized in class JavaScriptNodepublic JavaScriptNode getAccessNode()