-
Bug
-
Resolution: Fixed
-
P3
-
8, 9
-
None
-
b155
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8174463 | 10 | Hannes Wallnoefer | P3 | Resolved | Fixed | b01 |
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
[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
- backported by
-
JDK-8174463 in operator should work on java objects and classes
-
- Resolved
-