Class PropertyNode
java.lang.Object
com.oracle.js.parser.ir.Node
com.oracle.js.parser.ir.PropertyNode
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
ClassElement
IR representation of an object literal property.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final FunctionNodeProperty getter.protected final booleanprotected final booleanprotected final ExpressionProperty key.protected final FunctionNodeProperty setter.protected final ExpressionProperty value. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPropertyNode(long token, int finish, Expression key, Expression value, FunctionNode getter, FunctionNode setter, boolean isStatic, boolean computed, boolean isAnonymousFunctionDefinition) PropertyNode(long token, int finish, Expression key, Expression value, FunctionNode getter, FunctionNode setter, boolean isStatic, boolean computed, boolean coverInitializedName, boolean proto) PropertyNode(long token, int finish, Expression key, Expression value, FunctionNode getter, FunctionNode setter, boolean isStatic, boolean computed, boolean coverInitializedName, boolean proto, boolean classField, boolean isAnonymousFunctionDefinition) 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 getter for this propertygetKey()Return the key for this property nodeGet the name of the property keycom.oracle.truffle.api.strings.TruffleStringcom.oracle.truffle.api.strings.TruffleStringGet the setter for this propertygetValue()Get the value of this propertybooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisProto()booleanisRest()booleanisStatic()setGetter(FunctionNode getter) Set the getter of this property, null if nonesetSetter(FunctionNode setter) Set the setter for this property, null if nonesetValue(Expression value) Set the value of this propertyvoidtoString(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 Node
clone, equals, getFinish, getSourceOrder, getStart, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toString
-
Field Details
-
key
Property key. -
value
Property value. -
getter
Property getter. -
setter
Property setter. -
isStatic
protected final boolean isStatic -
computed
protected final boolean computed -
isAnonymousFunctionDefinition
protected final boolean isAnonymousFunctionDefinition
-
-
Constructor Details
-
PropertyNode
protected PropertyNode(long token, int finish, Expression key, Expression value, FunctionNode getter, FunctionNode setter, boolean isStatic, boolean computed, boolean isAnonymousFunctionDefinition) -
PropertyNode
public PropertyNode(long token, int finish, Expression key, Expression value, FunctionNode getter, FunctionNode setter, boolean isStatic, boolean computed, boolean coverInitializedName, boolean proto) -
PropertyNode
public PropertyNode(long token, int finish, Expression key, Expression value, FunctionNode getter, FunctionNode setter, boolean isStatic, boolean computed, boolean coverInitializedName, boolean proto, boolean classField, boolean isAnonymousFunctionDefinition) Constructor- Parameters:
token- tokenfinish- finishkey- the key of this propertyvalue- the value of this propertygetter- getter function bodysetter- setter function body
-
-
Method Details
-
getKeyName
-
getKeyNameTS
public com.oracle.truffle.api.strings.TruffleString getKeyNameTS() -
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 -
getGetter
Get the getter for this property- Returns:
- getter or null if none exists
-
setGetter
Set the getter of this property, null if none- Parameters:
getter- getter- Returns:
- same node or new node if state changed
-
getKey
-
getSetter
Get the setter for this property- Returns:
- setter or null if none exists
-
setSetter
Set the setter for this property, null if none- Parameters:
setter- setter- Returns:
- same node or new node if state changed
-
getValue
-
setValue
Set the value of this property- Parameters:
value- new value- Returns:
- same node or new node if state changed
-
isStatic
public boolean isStatic() -
isComputed
public boolean isComputed() -
isCoverInitializedName
public boolean isCoverInitializedName() -
isProto
public boolean isProto() -
isRest
public boolean isRest() -
isClassField
public boolean isClassField() -
isAnonymousFunctionDefinition
public boolean isAnonymousFunctionDefinition() -
isPrivate
public boolean isPrivate() -
getPrivateName
-
getPrivateNameTS
public com.oracle.truffle.api.strings.TruffleString getPrivateNameTS() -
isAccessor
public boolean isAccessor() -
isClassStaticBlock
public boolean isClassStaticBlock()
-