[Bug 12248] Make objects first-class API citizens

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

--- Comment #28 from Brendan Eich <brendan@mozilla.org> 2011-03-08 22:58:47 UTC ---
(In reply to comment #27)
> (In reply to comment #21)
> > How can you write a generalized serializer when only certain keyword parameters
> > specific to the method being specified, are wanted?
> > 
> > You can abstract a helper that looks for a list of keys, and returns a list of
> > values, say. But the processing for a given method-being-spec'ed will not first
> > blindly clone (by serialization) the object passed as keyword-parameter set.
> 
> I was thinking more of the structured clone use case (where you would serialize
> everything), and then extending it to work for this keyword parameter use case.

That is mixing unrelated use cases. Why?

Remember we are not trying to make every API "remoteable" -- even if we were,
there would be a proxy on the sending side, which would still run JS due to
implicit type conversions per WebIDL. There is no reason to cripple objects as
keyword parameter sets passed to such a proxy's method.

Structured cloning is used by IndexedDB in Gecko, where we want to throw on
functions and other non-enumerated type cases. Indeed this says to throw on
getters and setters, not skip them.

These are quite different use-cases which should not be conflated.

/be

-- 
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 22:58:49 UTC