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

Problems with native JSON functions

2 views
Skip to first unread message

John J Barton

unread,
Dec 16, 2009, 8:44:12 PM12/16/09
to
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.

Thanks,
jjb

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

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

sayrer

unread,
Dec 18, 2009, 10:57:00 AM12/18/09
to
On Dec 16, 8:44 pm, John J Barton <johnjbar...@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 Panelhttp://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.

From this email, I can't tell what the desired behavior is.

Can you give a simple test case and the expected results?

0 new messages