JSObject and delegation to other java classes
marc at openendedgroup.com
Mon Jul 21 15:34:47 UTC 2014
On Mon, Jul 21, 2014 at 6:11 AM, A. Sundararajan<
sundararajan.athijegannathan at oracle.com> wrote:
> Will this sample of any help to you?
It is! Many thanks.
What stopped me getting there myself? Well I fell into this trap: assigned
methods from the fallback class to temporary variables doesn't work
var ArrayList = Java.type('java.util.ArrayList')
var al = new ArrayList()
al.size() // WORKS, returns zero
var sz = al.size // works, sz is not undefined or null
sz() // throws ClassCastException
Obviously in your code you just do the lookup multiple times, but out of
interest: is there anything I can do with sz to call the underlying method?
What's it even for?
More information about the nashorn-dev