JSAdapter problem

A. Sundararajan sundararajan.athijegannathan at oracle.com
Tue May 28 05:06:13 PDT 2013


Hi Andreas,

JSAdapter in nashorn introduces __call__ method. This is called when a 
"method" is called on an object.

obj.x(); // --> calls __call__ method
obj.x // --> calls __get__ method

Thanks
-Sundar

On Monday 27 May 2013 03:36 PM, Andreas Rieber wrote:
> Hi,
>
> i just try to get the jconsole-plugin working and found the following 
> issue with JSAdapter:
>
> var obj = new JSAdapter() {
>     __get__: function (name) {
>         return function() {
>             print(name);
>         };
>     }
> };
>
> var func = obj.x;
> func();
> obj.x();
>
> Expected output should be x x but it fails with no such function "x". 
> Plain old Rhino did handle that case.
>
> Andreas
>



More information about the nashorn-dev mailing list