Class IndexNode
java.lang.Object
com.oracle.js.parser.ir.Node
com.oracle.js.parser.ir.Expression
com.oracle.js.parser.ir.OptionalExpression
com.oracle.js.parser.ir.BaseNode
com.oracle.js.parser.ir.IndexNode
- All Implemented Interfaces:
FunctionCall, Cloneable
IR representation of an indexed access (brackets operator.)
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionIndexNode(long token, int finish, Expression base, Expression index) IndexNode(long token, int finish, Expression base, Expression index, boolean isSuper, boolean optional, boolean optionalChain) Constructors -
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.getIndex()Get the index expression for this IndexNodesetIndex(Expression index) Set the index expression for this nodeMark this node as being a SuperProperty access.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 BaseNode
getBase, isFunction, isIndex, isOptional, isOptionalChain, isSuperMethods inherited from class Expression
getFinish, getFinishWithoutParens, getStart, getStartWithoutParens, isAlwaysFalse, isAlwaysTrue, isParenthesized, isSelfModifying, makeParenthesizedMethods inherited from class Node
clone, equals, getSourceOrder, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toString
-
Constructor Details
-
IndexNode
public IndexNode(long token, int finish, Expression base, Expression index, boolean isSuper, boolean optional, boolean optionalChain) Constructors- Parameters:
token- tokenfinish- finishbase- base node for accessindex- index for access
-
IndexNode
-
-
Method Details
-
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 -
getIndex
-
setIndex
Set the index expression for this node- Parameters:
index- new index expression- Returns:
- a node equivalent to this one except for the requested change.
-
setIsSuper
Description copied from class:BaseNodeMark this node as being a SuperProperty access.- Specified by:
setIsSuperin classBaseNode
-