W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2015

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

From: <bugzilla@jessica.w3.org>
Date: Sun, 18 Oct 2015 15:12:09 +0000
To: public-script-coord@w3.org
Message-ID: <bug-26985-3890-0tLAruiB5h@http.www.w3.org/Bugs/Public/>

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

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