Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Problems with native JSON functions

1 view
Skip to first unread message

Mike Shaver

unread,
Dec 17, 2009, 4:38:39 PM12/17/09
to John J Barton, SpiderMonkey Dev List, dev-pl...@lists.mozilla.org, say...@gmail.com
On Wed, Dec 16, 2009 at 8:44 PM, John J Barton
<johnj...@johnjbarton.com> wrote:
> A couple of CMU students added a "Copy object as json" feature to Firebug,
>  Issue 2560:     Add JSON String Copy to DOM Panel
> http://code.google.com/p/fbug/issues/detail?id=2560
>
> However they ended up having to modify json2.js to succeed rather than the
> native Firefox JSON methods. Obviously we'd rather not have two kinds of
> JSON code in Firebug.
>
> Apparently the problem is that the native functions fail with too much
> recursion on cycles, sometimes.
>
> The closest bug I found in bugzilla is
> https://bugzilla.mozilla.org/show_bug.cgi?id=512447
> JSON.stringify does not correct handle replacer functions that produce
> infinitely recursive objects
>
> Is anyone familiar with the status of native JSON support? If it is "we got
> most of it and now we are working on the rest" we'll just hold off on our
> feature.

We're committed to fixing known JSON bugs, not sure if some of them
are already fixed on trunk or tracemonkey. sayre will know more,
copying him here and moving to the JS engine group. We should get
those bugs fixed and their fixes backported, though, rather than
carrying another, lower-perf impl in Firebug.

If that bug isn't exactly what you're seeing, please provide much more
detail about the input you're providing to the stringify call -- the
ES5 spec covers some aspects of cycle behaviour, IIRC, but I thought
json2.js was also conforming, so there might be something else that's
up.

Mike

0 new messages