[Bug 12248] Make objects first-class API citizens

http://www.w3.org/Bugs/Public/show_bug.cgi?id=12248

--- Comment #25 from Allen Wirfs-Brock <allen@wirfs-brock.com> 2011-03-08 06:12:46 UTC ---
(In reply to comment #22)

> I have no problem with comment 14's (A), my problem is just that I don't know
> how to specify that such that it is interoperably implementable. This is a
> practical problem the simplest solution for which is just for someone to tell
> me what to write, not a philosophical one and not a disagreement on my part.

This is exactly what the JSON.stringify specification in ES5 does. It is a
serialization algorithm that deals with all of these issues except those that
are linked to resource consumption.  Implementations that correctly follow the
specification will have identical interoperable behavior, even in the presence
of things like getters that dynamic modify the structure that is being
serialized.  Only resource exhaustion issues (infinite recursion, etc.) don't
have totally deterministic behavior among implementations.

JSON.stringify would be a good starting point for a more detailed structured
clone algorithm. When I will still at Microsoft, I believe that Travis Leithead
and I actually talked about doing this but we had higher priority issues to
deal with at that time.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Tuesday, 8 March 2011 06:12:48 UTC