I am creating a JavaScript object from a set of Java objects. I am using a Java library that parses an email. It is doing quite a bit of recursion. It seems to be working, but when I try to do an Myna.print(object.toJson) to take a look at what is being generated, I get a stack overflow. Is there any easy way to increase the stack size? Or do I basically need to try and generate the text? Or do I need to make this a much simpler object?
I am creating a JavaScript object from a set of Java objects. I am using a Java library that parses an email. It is doing quite a bit of recursion. It seems to be working, but when I try to do an Myna.print(object.toJson) to take a look at what is being generated, I get a stack overflow. Is there any easy way to increase the stack size? Or do I basically need to try and generate the text? Or do I need to make this a much simpler object?
toJson() should really be reserved for data obects. In particular it cannot handle circular references which cause infinite recursion and stack overflow. Myna.dump/printDump/textDump handle this by setting a max depth to prevent stack overflow and are a good choice for debugging. ---------------------------------------------------------- Mark Porter
Myna JavaScript Application Server Easy web development with server-side JavaScript http://www.mynajs.org
On Wed, Dec 15, 2010 at 11:18 AM, Tony Zakula <tonyzak...@gmail.com> wrote: > The Rhino toSource() seemed to do the trick.
> Hi all,
> I am creating a JavaScript object from a set of Java objects. I am > using a Java library that parses an email. It is doing quite a bit of > recursion. It seems to be working, but when I try to do an > Myna.print(object.toJson) to take a look at what is being generated, I > get a stack overflow. Is there any easy way to increase the stack > size? Or do I basically need to try and generate the text? Or do I > need to make this a much simpler object?
> Thanks,
> Tony Z
> -- > You received this message because you are subscribed to the Google Groups "MynaJS-General" group. > To post to this group, send email to mynajs-general@googlegroups.com. > To unsubscribe from this group, send email to mynajs-general+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/mynajs-general?hl=en.