[Bug 26985] Remove requirement for prose around iterable<> if object has indexed properties

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

Boris Zbarsky <bzbarsky@mit.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |annevk@annevk.nl
              Flags|                            |needinfo?(d@domenic.me),
                   |                            |needinfo?(annevk@annevk.nl)

--- Comment #4 from Boris Zbarsky <bzbarsky@mit.edu> ---
So the fact that putting a single-type iterable decl on DOMTokenList, say,
means keys() will produce the same thing as values() (per planned spec changes;
see <https://bugzilla.mozilla.org/show_bug.cgi?id=1215925#c2>) is broken imo.

I think the right thing to say is that for the case of indexed props and
iterable<> the following apply:

1)  Either the iterable<> declaration needs to take no type or its type must
match the type of the indexed getter.

2)  keys/values/entries should use CreateArrayIterator or just be set to the
relevant Array.prototype functions.

3)  forEach should perhaps also be Array.prototype.forEach.

But really, it would be simpler to make the class [LegacyArrayClass] (which is
legacy why again?), because then you get all of the above for free, plus map()
and filter().  Why is this not a superior approach?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Sunday, 18 October 2015 15:12:12 UTC