Re: JSON.stringify does not support Java class that extends AbstractJSObject

2016-06-12 Thread Sundararajan Athijegannathan
Well, the basic property access/modification, indexed element access/modification, function call etc. are indeed glued to JSObject methods. Nashorn includes separate dynalink linker to implement this. But, a JSObject is *not* a Nashorn ScriptObject in *every* possible context. This is by design. Th

JSON.stringify does not support Java class that extends AbstractJSObject

2016-06-10 Thread Bill Reed
I have a Java class ExampleTuple2 that extends AbstractJSObject. My ExampleTuple2 has a toJSON method. I instantiate the object in JavaScript (nashorn) if I do a JSON.stringify(tuple2Instance) the result "undefined" The API documentation for AbstractJSObject https://docs.oracle.com/javase/8/docs/