Class ObjectNode
java.lang.Object
com.oracle.js.parser.ir.Node
com.oracle.js.parser.ir.Expression
com.oracle.js.parser.ir.ObjectNode
- All Implemented Interfaces:
Cloneable
IR representation of an object literal.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionObjectNode(long token, int finish, List<PropertyNode> elements, boolean hasTrailingComma) Constructor -
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.Get the elements of this literal nodebooleanReturns whether this object literal has a comma after the last element.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 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
-
ObjectNode
Constructor- Parameters:
token- tokenfinish- finishelements- the elements used to initialize this ObjectNodehasTrailingComma- whether the object literal has a comma after the last element
-
-
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 -
getElements
Get the elements of this literal node- Returns:
- a list of elements
-
hasTrailingComma
public boolean hasTrailingComma()Returns whether this object literal has a comma after the last element.
-