JSAdapter problem

Andreas Rieber rieberandreas at gmail.com
Tue May 28 07:49:46 PDT 2013


Hi Sundar,

is it worth adding a compatibility or migration section to 
nashorn/docs/JavaScriptingProgrammersGuide.html? With the Rhino 
JSAdapter the __get__ method could return a function and there was no 
such __call__ method.

regards
Andreas

On 28.05.13 14:06, A. Sundararajan wrote:
> 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