Comments to the JSON related proposals
kriszyp at xucia.com
Mon Aug 20 07:57:06 PDT 2007
> question arises: How would ad-hoc transient properties be set or
> initialized in any old object?
With classes being available, why not provide a pathway for developers to
define transience correctly in proper OO manner that would be serialization
method agnostic, rather than adding a blacklisted array parameter to
toJSONString, which IMHO is very poor and shortsighted way of defining
transient/temporary keys? You are right that it would not available for
plain old objects, or perhaps it could be. Transience would be a property
attribute, and could be set just like defining enumerability of properties,
although I would hate to suggest another method on Object.prototype.
> Dropping a namespace qualifier is bad because it will lead to local name
> collisions (Murphy says). In general, silently dropping names and types
> that don't fit in JSON seems like deadly silence, not the golden kind.
I thought that dropping namespace qualifier had already been decided on. Is
this still in question? I certainly agree that dropping namespaces seems
dangerous, and when I asked before it was suggested that there could just
simply be multiple identical keys in a JSON serialization output. Seems a
little odd to stringify to something that is not even coherent JSON.
More information about the Es4-discuss