At this point it's hard to say whether or not the exact handling of this specific edge case was intentional or not. However, it isn't obvious that this behavior is any worse or better than the possible alternatives so I don't think we have a strong case for changing it. Particularly, since it has been specified this way for in drafts for quite a while.
We're about a year past json2.js serving as the reference implementation for the ES5 JSON spec. (although I believe Crock has done some json2.js updates to track the ES5 spec.) There are some things in the current algorithms that just can't be easily accomplished in pure ES3 code. Allen From: [email protected] [mailto:[email protected]] On Behalf Of Oliver Hunt Sent: Wednesday, August 26, 2009 8:23 PM To: Oliver Hunt Cc: [email protected] Subject: Re: more JSON spec questions On Aug 26, 2009, at 4:22 PM, Oliver Hunt wrote: Yup. You may also want tests for use of replacer arrays and functions, etc On this topic, i'm fixing an issue in our handling of reviver functions in JSON.parse and noticed that json2.js and the JSON.parse specification differ in the handling of properties being deleted from the holder object, namely if a reviver function deletes a property from holder before it is visited then the current spec behaviour would imply that that property is still visited, only with the value undefined. While json2.js disagrees with this implementation the firefox implementation does match spec here, so i'd just like to verify that the currently specified behaviour is intended (this is sufficiently edge-case like for me to doubt it has any significant compatibility impact, i just want clarification) --Oliver
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

