Class JSProperty

java.lang.Object
com.oracle.truffle.js.runtime.objects.JSProperty

public final class JSProperty extends Object
Property objects represent the mapping between low-level stores and high-level data. The simplest Property could be nothing more than a map of one index to one property's value, but abstracting the interface allows for getter/setter methods, type-checked properties, and other such specialized and language-specific behavior.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    JS accessor property (implies not a data property).
    static final int
    Used for global scope const bindings.
    static final int
    Module namespace object export binding (special data property).
    static final int
    Special JS data property using internal PropertyProxy accessor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static String
    getAttributeString(com.oracle.truffle.api.object.Property property, boolean positive)
     
    getConstantProxy(com.oracle.truffle.api.object.Property proxyProperty)
     
    static Object
    getValue(com.oracle.truffle.api.object.Property property, JSDynamicObject store, Object thisObj, com.oracle.truffle.api.nodes.Node encapsulatingNode)
    Get the value assigned to this property in the given object and store.
    static boolean
    isAccessor(int flags)
     
    static boolean
    isAccessor(com.oracle.truffle.api.object.Property property)
     
    static boolean
    isConfigurable(int flags)
     
    static boolean
    isConfigurable(com.oracle.truffle.api.object.Property property)
     
    static boolean
    isConst(int flags)
     
    static boolean
    isConst(com.oracle.truffle.api.object.Property property)
     
    static boolean
    isData(int flags)
     
    static boolean
    isData(com.oracle.truffle.api.object.Property property)
     
    static boolean
    isDataSpecial(int flags)
     
    static boolean
    isDataSpecial(com.oracle.truffle.api.object.Property property)
     
    static boolean
    isEnumerable(int flags)
     
    static boolean
    isEnumerable(com.oracle.truffle.api.object.Property property)
     
    static boolean
     
    static boolean
    isModuleNamespaceExport(com.oracle.truffle.api.object.Property property)
     
    static boolean
    isProxy(int flags)
     
    static boolean
    isProxy(com.oracle.truffle.api.object.Property property)
     
    static boolean
    isWritable(int flags)
     
    static boolean
    isWritable(com.oracle.truffle.api.object.Property property)
     
    static boolean
    setValue(com.oracle.truffle.api.object.Property property, JSDynamicObject store, Object thisObj, Object value, boolean isStrict, com.oracle.truffle.api.nodes.Node encapsulatingNode)
    Set the value assigned to this property in the given object and store.
    static String
    toString(com.oracle.truffle.api.object.Property property)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ACCESSOR

      public static final int ACCESSOR
      JS accessor property (implies not a data property).
      See Also:
    • PROXY

      public static final int PROXY
      Special JS data property using internal PropertyProxy accessor.
      See Also:
    • CONST

      public static final int CONST
      Used for global scope const bindings.
      See Also:
    • MODULE_NAMESPACE_EXPORT

      public static final int MODULE_NAMESPACE_EXPORT
      Module namespace object export binding (special data property).
      See Also:
  • Method Details

    • toString

      public static String toString(com.oracle.truffle.api.object.Property property)
    • getAttributeString

      protected static String getAttributeString(com.oracle.truffle.api.object.Property property, boolean positive)
    • getValue

      public static Object getValue(com.oracle.truffle.api.object.Property property, JSDynamicObject store, Object thisObj, com.oracle.truffle.api.nodes.Node encapsulatingNode)
      Get the value assigned to this property in the given object and store.
      Parameters:
      store - the store that this property's value resides in
      thisObj - the object that this property was found in
      Returns:
      the value assigned to this property
    • setValue

      public static boolean setValue(com.oracle.truffle.api.object.Property property, JSDynamicObject store, Object thisObj, Object value, boolean isStrict, com.oracle.truffle.api.nodes.Node encapsulatingNode)
      Set the value assigned to this property in the given object and store.
      Parameters:
      store - the store that this property's value resides in
      thisObj - the object that this property was found in
      value - the value to assign to this property
      isStrict - whether the set is in a strict mode function
    • isConfigurable

      public static boolean isConfigurable(com.oracle.truffle.api.object.Property property)
    • isEnumerable

      public static boolean isEnumerable(com.oracle.truffle.api.object.Property property)
    • isWritable

      public static boolean isWritable(com.oracle.truffle.api.object.Property property)
    • isProxy

      public static boolean isProxy(com.oracle.truffle.api.object.Property property)
    • isAccessor

      public static boolean isAccessor(com.oracle.truffle.api.object.Property property)
    • isData

      public static boolean isData(com.oracle.truffle.api.object.Property property)
    • isConst

      public static boolean isConst(com.oracle.truffle.api.object.Property property)
    • isModuleNamespaceExport

      public static boolean isModuleNamespaceExport(com.oracle.truffle.api.object.Property property)
    • isDataSpecial

      public static boolean isDataSpecial(com.oracle.truffle.api.object.Property property)
    • isConfigurable

      public static boolean isConfigurable(int flags)
    • isEnumerable

      public static boolean isEnumerable(int flags)
    • isWritable

      public static boolean isWritable(int flags)
    • isProxy

      public static boolean isProxy(int flags)
    • isAccessor

      public static boolean isAccessor(int flags)
    • isData

      public static boolean isData(int flags)
    • isConst

      public static boolean isConst(int flags)
    • isModuleNamespaceExport

      public static boolean isModuleNamespaceExport(int flags)
    • isDataSpecial

      public static boolean isDataSpecial(int flags)
    • getConstantProxy

      public static PropertyProxy getConstantProxy(com.oracle.truffle.api.object.Property proxyProperty)