in operator should work on java objects and classes

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: 8, 9
    • Component/s: core-libs
    • None
    • b155
    • generic
    • generic

        Java objects behave much like JS objects in Nashorn in that JavaBean properties can be accessed and methods invoked just like JS properties and functions. However, the "in" operator[1] is not supported by Java objects and always evaluates to false.

        [1] http://es5.github.io/#x11.8.7

        I stumbled over this when investigating a problem running mustache.js with Nashorn reported on nashorn-dev:

        http://mail.openjdk.java.net/pipermail/nashorn-dev/2017-January/006810.html

        Since we treat java properties and methods like JS properties and functions, it seems we should also support the in operator. This would include the following:

         - instance properties and methods on java objects
         - static properties and methods on java classes
         - map keys on instances of java.util.Map
         - indices for instances of java.util.List and arrays

              Assignee:
              Hannes Wallnoefer
              Reporter:
              Hannes Wallnoefer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: