[Bug 23212] Add iterator support to NodeList, HTMLCollection, DOMTokenList, and DOMSettableTokenList

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23212

--- Comment #4 from Boris Zbarsky <bzbarsky@mit.edu> ---
You have it backwards.

Per http://heycam.github.io/webidl/#es-iterators you get an @@iterator if you
have indexed props and a length, or an iterable declaration, maplike
declaration, or setlike declaration.

If you have an iterable declaration you then have to specify how it behaves. 
And the important part for purposes of this bug is this paragraph:

  If the interface does not have an iterable declaration but does define an
  indexed property getter, then the Function object is %ArrayProto_values%
  ([ECMA-262], section 6.1.7.4). 

I see that http://heycam.github.io/webidl/#idl-iterable has this language:

  Prose accompanying an interface with a value iterator MUST define what the
  list of values to iterate over is, unless the interface also supports indexed
  properties, in which case the values of the indexed properties are implicitly
  iterated over.

which certainly makes it sound like in the indexed prop case iteration happens
over those even in the face of an iterable declaration.  This is flat-out
contradicting the normative language in the es-iterators section, and I can
only assume that this is a bug I didn't catch in reading over the text in bug
26183 because I only read the ES-relevant bits...  I'll comment there.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 6 October 2014 04:54:24 UTC