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

Re: Contacts API -- attribute order

From: Allen Wirfs-Brock <allen@wirfs-brock.com>
Date: Thu, 25 Aug 2011 09:33:41 -0700
Message-Id: <B07F407B-A29F-491A-87A2-D1A34CEBD7D4@wirfs-brock.com>
To: public-script-coord@w3.org
A couple thoughts  on this general topic.

1) WebDL clause 3 should not say anything about enumeration of attributes or operations as this isn't a language independent capability. (I think it is currently fine in this regard).  It should say in 3.3.2 that the physical ordering of attributes in WebIDL fragments does not imply an enumeration ordering or any other implicit semantics. 
2) the only thing that Clause 4.7.6 should say is that it defers to the ECMAScript specification in this regard.  In addition it should not attempt to specify the enumerations that is currently does.  In practice a Web API that is implemented using ES may not have any control over enumeration order so requiring one isn't helpful.
3) Web APIs should never be designed with the expatiation that the enumeration order has any semantic significance.  If an API needs to accept or return an ordered set of values then it should explicitly use the WebIDL Array or Sequence type rather than an object interface.  This should be explicitly stated somewhere.  Perhaps in 4.7.6 or perhaps in 3.9.18/19.


Basically, leave it to TC39 to struggle with ES property enumeration issues, but make sure that no Web API are defined that depend upon a specific ES property enumeration order.

Allen
Received on Thursday, 25 August 2011 16:34:14 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:04 UTC