>So it would produce copies of literals, but references of objects/arrays?
Yes, it would.
>and could be parsed so adding a member to either obj.b or ob.a would
update the other one. This would therefore be >more powerfull than simply
copying the same values to the different names when parsing.
I don't quite sure about what do you mean by “update”. obj.a and obj.b
should be the same object. There are no third object in this case.
Consider the following code:
var obj = JSON.parseEx(" {\
\"b\": {},\
\"a\": path(/b)\
} ");
obj.a===obj.b would be true. They are the same object.
2012/3/5 Marius Gundersen <[email protected]>
> 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
>> }
>>
>
> So it would produce copies of literals, but references of objects/arrays?
>
> For example:
> var obj = {};
> obj.b = {};
> obj.a = obj.b;
>
> Would produce:
>
> {
> "b": {},
> "a": path(/b)
> }
>
> and could be parsed so adding a member to either obj.b or ob.a would
> update the other one. This would therefore be more powerfull than simply
> copying the same values to the different names when parsing.
>
> Marius Gundersen
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss