Re: [webidl] Add a [Maplike] tag?

Tab Atkins Jr. wrote:
> I've gone ahead and started using some pretend syntax for this in
> <http://dev.w3.org/csswg/css-variables/#the-CSSVariablesMap-interface>:

I've added most of this now:

   http://dev.w3.org/2006/webapi/WebIDL/#MapClass
   http://dev.w3.org/2006/webapi/WebIDL/#es-map-members

> [MapClass(DOMString, DOMString)]
> interface CSSVariablesMap {
>    DOMString get(DOMString varName);
>    boolean has(DOMString varName);
>    void set(DOMString varName, DOMString varValue);
>    DOMString delete(DOMString varName);
> }
>
> The [MapClass(keyType, valType, iteratorType?)] extended attribute
> takes two or three arguments.  The first two specify the types
> required of its keys and values.  The interface MUST define the "map
> tuples" for the interface, which consist of a unique key paired with a
> value.  Unless manually defined in the interface, the entries(),
> keys(), and values() methods, and the .size attribute, are
> automatically defined in terms of the "map tuples".  The third
> argument to the extended attribute defines which of the three is used
> for the @@iterator() method, and must be either "entries", "keys",
> "values", or omitted (which is the same as "entries").

I haven't added the iterator type argument to [MapClass] yet.  Can you 
go into some more detail about how that would work?

The spec needs a bunch of updating for iterators defined by @@iterator 
anyway.


Please have a look at the new text and let me know if there are any issues.

Received on Thursday, 27 June 2013 09:27:48 UTC