Class BaseNode
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
- All Implemented Interfaces:
FunctionCall,Cloneable
- Direct Known Subclasses:
AccessNode,IndexNode
IR base for accessing/indexing nodes.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionBaseNode(long token, int finish, Expression base, boolean isSuper, boolean optional, boolean optionalChain) ConstructorprotectedBaseNode(BaseNode baseNode, Expression base, boolean isSuper, boolean optional, boolean optionalChain) Copy constructor for immutable nodes -
Method Summary
Modifier and TypeMethodDescriptiongetBase()Get the base node for this accessbooleanReturns true if the value of this expression will be treated as a function and immediately invoked.booleanisIndex()Return true if this node represents an index operation normally represented asIndexNode.final booleanReturnstrueif this is an optional property access (a?.bora?.[b]).final booleanReturnstrueif this part of an optional chain.booleanisSuper()abstract BaseNodeMark this node as being a SuperProperty access.Methods inherited from class com.oracle.js.parser.ir.Expression
getFinish, getFinishWithoutParens, getStart, getStartWithoutParens, isAlwaysFalse, isAlwaysTrue, isParenthesized, isSelfModifying, makeParenthesizedMethods inherited from class com.oracle.js.parser.ir.Node
accept, accept, clone, equals, getSourceOrder, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toString, toString
-
Field Details
-
base
Base Node.
-
-
Constructor Details
-
BaseNode
public BaseNode(long token, int finish, Expression base, boolean isSuper, boolean optional, boolean optionalChain) Constructor- Parameters:
token- tokenfinish- finishbase- base nodeisSuper- is this a super property access
-
BaseNode
protected BaseNode(BaseNode baseNode, Expression base, boolean isSuper, boolean optional, boolean optionalChain) Copy constructor for immutable nodes- Parameters:
baseNode- node to inherit frombase- baseisSuper- is this a super property access
-
-
Method Details
-
getBase
-
isFunction
public boolean isFunction()Description copied from interface:FunctionCallReturns true if the value of this expression will be treated as a function and immediately invoked.- Specified by:
isFunctionin interfaceFunctionCall
-
isSuper
public boolean isSuper()- Returns:
trueif this is asuperproperty access.
-
isIndex
public boolean isIndex()Return true if this node represents an index operation normally represented asIndexNode.- Returns:
- true if an index access.
-
setIsSuper
Mark this node as being a SuperProperty access. -
isOptional
public final boolean isOptional()Returnstrueif this is an optional property access (a?.bora?.[b]).- Specified by:
isOptionalin classOptionalExpression
-
isOptionalChain
public final boolean isOptionalChain()Description copied from class:OptionalExpressionReturnstrueif this part of an optional chain.- Specified by:
isOptionalChainin classOptionalExpression
-