W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2011

[Bug 12248] Make objects first-class API citizens

From: <bugzilla@jessica.w3.org>
Date: Tue, 08 Mar 2011 04:10:16 +0000
To: public-script-coord@w3.org
Message-Id: <E1PwoFU-00066T-U9@jessica.w3.org>

--- Comment #21 from Brendan Eich <brendan@mozilla.org> 2011-03-08 04:10:16 UTC ---
(In reply to comment #18)
> Well, not the *method* getting it, but the binding glue when marshalling
> arguments from JS to the DOM implementation.


> The generalized version of ToPropertyDescriptor that would be used here would
> serialize the whole object graph starting from its argument.  (At least, that's
> how I imagined the serialization to work.)  That could well result in getting a
> property "whose value it [the method] does not use".

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.

> ToPropertyDescriptor itself doesn't look at properties other than "enumerable",
> "configurable", etc.  My (A) would look at every property on the object (and
> its objects (and its objects...)).

Why? Can you show any DOM or WebAPI/Apps methods being proposed or already
spec'ed that use such a "deep" keyword-parameter-set object?

What problem is being solved here? I thought the issue was how to spec a method
M called like so (say on a DOM node N):

  N.M(arg1, arg2, {key1:val1,  ... keyN:valN});

where M interprets the final positional parameter by looking for a fixed set of
keyword parameter property names.


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 04:10:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:02 UTC