sadhak001 at gmail.com
Sun Jun 9 22:12:06 PDT 2013
Thanks very much Sundar , it worked like a charm! I'll push the changes
into my repo and also fix empty folders issue, so that it can be used as an
example by other adopters of Nashorn!
Feel free to link this repo to your other blogs or resources on Nashorn -
I'm looking forward to spreading more awareness about this project through
my channels (also as an LJC Advocate for the Adopt programs).
On Mon, Jun 10, 2013 at 4:55 AM, A. Sundararajan <
sundararajan.athijegannathan at oracle.com> wrote:
> Script arrays are accessed via JSObject as well. You've
> JSObject.get/setSlot methods to access array elements. Array length can be
> accessed using JSObject.getMember("length")
> On Sunday 09 June 2013 10:48 PM, Mani Sarkar wrote:
> ---------- Forwarded message ----------
> From: Mani Sarkar <sadhak001 at gmail.com>
> Date: Sun, Jun 9, 2013 at 11:30 AM
> To: nashorn-dev at openjdk.java.net
> Hi guys,
> I have resolved the earlier error that I reported, I thought I was using
> the correct jdk but then I wasn't and switching to the latest version of
> the OpenJDK (nashorn) source and then bootstrapping to the image created by
> the build process fixed it (hinted by you) - thanks for that.
> through the JSObject. Although the JSON I created also contained an array
> of string elements, which I wasn't able to access but got [object Array]
> when I printed it to console.
> I tried casting it to org.json.JSONArray but it was of no use. Then I
> came across the link
> and applying the checks on the object to see if it can be converted or not
> I got the output:
> function.apply.expects.array (didn't pass any of the checks, and
> terminated at the last else).
> Is there a JSONArray object within the nashorn package that I could use?
> Do you have any other example for that?
> On Fri, Jun 7, 2013 at 8:03 PM, Mani Sarkar <sadhak001 at gmail.com> wrote:
>> Thanks Sundar, Jim for the explanation.
>> I extracted the jsobjectTest() from ScriptEngineTest.java as it is and
>> compiled and ran it, when I run it I still get the same error that I got
>> with my example. I have put all of this in a gist to demonstrate what I was
>> I also ran the ScriptEngineTest using the jtreg command and that ran
>> ~/jtreg/linux/bin/jtreg -jdk:/usr/lib/jdk1.8.0
>> -verbose:fail test/src/jdk/nashorn/api/scripting/ScriptEngineTest.java
> *Twitter:* @theNeomatrix369 *Blog:*
> *JUG activity:* LJC Advocate (@adoptopenjdk & @adoptajsr programs)
> *Meet-a-Project:* https://github.com/MutabilityDetector
> *Bitbucket:* https://bitbucket.org/neomatrix369 * **Github:* https://
> *LinkedIn:* http://uk.linkedin.com/pub/mani-sarkar/71/a77/39b
> *Devoxx UK 2013* was a grand success:
> *Don't chase success, rather aim for "Excellence", and success will come
> chasing after you!*
*Twitter:* @theNeomatrix369 *Blog:*
*JUG activity:* LJC Advocate (@adoptopenjdk & @adoptajsr programs)
*Bitbucket:* https://bitbucket.org/neomatrix369 * **Github:* https://github
*Devoxx UK 2013* was a grand success:
*Don't chase success, rather aim for "Excellence", and success will come
chasing after you!*
More information about the nashorn-dev