Class DynamicObject.RemoveKeyNode

java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.object.DynamicObject.RemoveKeyNode
All Implemented Interfaces:
NodeInterface, Cloneable
Enclosing class:
DynamicObject

public abstract static class DynamicObject.RemoveKeyNode extends Node
Removes the property with the given key from the object.
Since:
25.1
See Also:
  • Method Details

    • execute

      public abstract boolean execute(DynamicObject receiver, Object key)
      Removes the property with the given key from the object.

      Usage example:

      @ExportMessage
      void removeMember(String member,
                      @Cached @Shared DynamicObject.GetShapeFlagsNode getShapeFlagsNode,
                      @Cached DynamicObject.RemoveKeyNode removeKeyNode) throws UnknownIdentifierException, UnsupportedMessageException {
          if ((getShapeFlagsNode.execute(this) & FROZEN) == FROZEN) {
              throw UnsupportedMessageException.create();
          }
          if (!removeKeyNode.execute(this, member)) {
              throw UnknownIdentifierException.create(member);
          }
      }
      
      Member name equality check omitted for brevity.
      Parameters:
      key - the property key, compared by identity (==), not equality (equals). See DynamicObject for more information.
      Returns:
      true if the property was removed or false if property was not found
    • create

      public static DynamicObject.RemoveKeyNode create()
      Since:
      25.1
    • getUncached

      public static DynamicObject.RemoveKeyNode getUncached()
      Since:
      25.1