Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8191905

Add a REMOVE value to jdk.dynalink.StandardOperation enum

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 10
    • 10
    • core-libs
    • None
    • b36
    • generic
    • generic

      Add a new enum value `REMOVE` to `jdk.dynalink.StandardOperation` to represent removal of a named value from an object's namespace.

      Language implementers have previously observed (see http://mail.openjdk.java.net/pipermail/nashorn-dev/2016-May/006222.html) that Dynalink does not provide an operation for deleting a property of an object, or a member of a collection, something fairly common in dynamic languages (and distinct from, say, setting a property value to null). Their request to provide REMOVE as a standard operation is quite justified.

      Along with defining the operation itself, BeansLinker needs to provide default REMOVE semantics for elements of Lists and Maps.

      If Dynalink defined a REMOVE operation, Nashorn's implementation of JavaScript `delete` operator could also get reimplemented on top of it. (Not in scope for this issue, but a follow-up.)

            attila Attila Szegedi
            attila Attila Szegedi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: