Re: org.mozilla.javascript.NativeArray toJSON error

"Hannes Wallnoefer" <[email protected]> Wed, 1 Oct 2008 13:54:06 +0200
Newsgroups gmane.comp.java.helma.general
Message-ID <[email protected]>
--===============0688260783==
Content-Type: multipart/alternative; 
	boundary="----=_Part_53041_10987001.1222862046396"

------=_Part_53041_10987001.1222862046396
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi Julian,

my first guess would have been that the parent scope or prototype of the
array are wrong or null, maybe because it has been serialized/deserialized
or was created in another scope.

org.mozilla.javascript.NativeArray is indeed the class Rhino uses to
implement javascript arrays, but you shouldn't see that when you do an
uneval() or toSource().

Hannes

PS the helma mailing list has moved to
http://groups.google.com/group/helma- I just haven't managed to turn
the switch on the old list yet :-) So I'm
cross-posting my answer to the new list.

2008/10/1 Julian Tree <[email protected]>

> Sometimes when I have an object with arrays
>
> I'm doing
>
> if(!session.data.jobulousSurvey.Review.responses)
> session.data.jobulousSurvey.Review.responses = []
>
> if I uneval.
>
> uneval(session.data.jobulousSurvey.Review.responses)  // this is  end up to
> be org.mozilla.javascript.NativeArray
>
> 1. why is this happening?
> 2. this doesn't work with session.data.jobulousSurvey.Review.toJSON()
>
> I don't really mind using a mozilla array, as long as I can use toJSON
> method on it.
>
> Any recommendation or insight as why this is happening?  Is this a bug?
>
> Julian
>
> _______________________________________________
> Helma-user mailing list
> [email protected]
> http://helma.org/mailman/listinfo/helma-user
>
>

------=_Part_53041_10987001.1222862046396
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div dir="ltr">Hi Julian,<br><br>my first guess would have been that the parent scope or prototype of the array are wrong or null, maybe because it has been serialized/deserialized or was created in another scope. <br><br>
org.mozilla.javascript.NativeArray is indeed the class Rhino uses to implement javascript arrays, but you shouldn&#39;t see that when you do an uneval() or toSource().<br><br>Hannes<br><br>PS the helma mailing list has moved to <a href="http://groups.google.com/group/helma">http://groups.google.com/group/helma</a> - I just haven&#39;t managed to turn the switch on the old list yet :-) So I&#39;m cross-posting my answer to the new list.<br>
<br>2008/10/1 Julian Tree <span dir="ltr">&lt;<a href="mailto:[email protected]">[email protected]</a>&gt;</span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Sometimes when I have an object with arrays <br><br>I&#39;m doing <br><br>if(!session.data.jobulousSurvey.Review.responses) session.data.jobulousSurvey.Review.responses = []<br><br>if I uneval. <br>
<br>uneval(session.data.jobulousSurvey.Review.responses)&nbsp; // this is&nbsp; end up to be org.mozilla.javascript.NativeArray<br><br>1. why is this happening? <br>2. this doesn&#39;t work with session.data.jobulousSurvey.Review.toJSON()<br>

<br>I don&#39;t really mind using a mozilla array, as long as I can use toJSON method on it.<br><br>Any recommendation or insight as why this is happening?&nbsp; Is this a bug? <br><br>Julian <br></div>
<br>_______________________________________________<br>
Helma-user mailing list<br>
<a href="mailto:[email protected]">[email protected]</a><br>
<a href="http://helma.org/mailman/listinfo/helma-user" target="_blank">http://helma.org/mailman/listinfo/helma-user</a><br>
<br></blockquote></div><br></div>

------=_Part_53041_10987001.1222862046396--

--===============0688260783==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Helma-user mailing list
[email protected]
http://helma.org/mailman/listinfo/helma-user

--===============0688260783==--