Consider extending JSON grammar to support objects with circular reference

程劭非 csf178 at gmail.com
Mon Mar 5 04:20:13 PST 2012


JSON.stringfyEx will never produce text like this but JSON.parseEx accept
this form.

I mean
{
    a:11,
    b:path(/a)
}
will act all the same with
{
    a:11,
    b:11
}

2012/3/5 Marius Gundersen <gundersen at gmail.com>

> // path could also point to a none-object value
>> {
>>     a:11,
>>     b:path(/a)
>> }
>>
>
> How would you build this from a JavaScript object? There is (so far) no
> way to have a reference to a none-object value, so there would be no way to
> construct this json object from a JavaScript object, and no way to
> recontstruct a JavaScript object from this json string. Therefore paths
> should only be able to refer to objects or arrays.
>
> Marius Gundersen
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120305/ac9311a5/attachment.html>


More information about the es-discuss mailing list