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

public class PropertyNode extends Node
IR representation of an object literal property.
  • Field Details

    • key

      protected final Expression key
      Property key.
    • value

      protected final Expression value
      Property value.
    • getter

      protected final FunctionNode getter
      Property getter.
    • setter

      protected final FunctionNode 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 - token
      finish - finish
      key - the key of this property
      value - the value of this property
      getter - getter function body
      setter - setter function body
  • Method Details

    • getKeyName

      public String getKeyName()
      Get the name of the property key
      Returns:
      key name
    • getKeyNameTS

      public com.oracle.truffle.api.strings.TruffleString getKeyNameTS()
    • accept

      public Node accept(NodeVisitor<? extends LexicalContext> visitor)
      Description copied from class: Node
      Provides a means to navigate the IR.
      Specified by:
      accept in class Node
      Parameters:
      visitor - Node visitor.
      Returns:
      node the node or its replacement after visitation, null if no further visitations are required
    • accept

      public <R> R accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
      Description copied from class: Node
      Provides a means to navigate the IR.
      Specified by:
      accept in class Node
      Parameters:
      visitor - Node visitor.
      Returns:
      node the node or its replacement after visitation, null if no further visitations are required
    • toString

      public void toString(StringBuilder sb, boolean printType)
      Description copied from class: Node
      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 value
      Specified by:
      toString in class Node
      Parameters:
      sb - string builder
      printType - print type?
    • getGetter

      public FunctionNode getGetter()
      Get the getter for this property
      Returns:
      getter or null if none exists
    • setGetter

      public PropertyNode setGetter(FunctionNode getter)
      Set the getter of this property, null if none
      Parameters:
      getter - getter
      Returns:
      same node or new node if state changed
    • getKey

      public Expression getKey()
      Return the key for this property node
      Returns:
      the key
    • getSetter

      public FunctionNode getSetter()
      Get the setter for this property
      Returns:
      setter or null if none exists
    • setSetter

      public PropertyNode setSetter(FunctionNode setter)
      Set the setter for this property, null if none
      Parameters:
      setter - setter
      Returns:
      same node or new node if state changed
    • getValue

      public Expression getValue()
      Get the value of this property
      Returns:
      property value
    • setValue

      public PropertyNode setValue(Expression value)
      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

      public String getPrivateName()
    • getPrivateNameTS

      public com.oracle.truffle.api.strings.TruffleString getPrivateNameTS()
    • isAccessor

      public boolean isAccessor()
    • isClassStaticBlock

      public boolean isClassStaticBlock()