[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|                            |bzbarsky@mit.edu,
                   |                            |cam@mcc.id.au,
                   |                            |domenic@domenicdenicola.com

--- Comment #1 from Boris Zbarsky <bzbarsky@mit.edu> ---
Basically, the proposal is that http://heycam.github.io/webidl/#es-iterators
would go something like this:

  If the interface defines an indexed property getter, then the Function object
  is %ArrayProto_values% ([ECMA-262], section 6.1.7.4).

  If the interface has an iterable declaration and does not define an indexed
  property getter, ...

  If the has a maplike declaration or setlike declaration and does not define
  an indexed property getter, ...

That would actually make sense with the prose at
http://heycam.github.io/webidl/#dfn-values-to-iterate-over which defines
"values to iterate over" for the indexed case.  We'd still need to modify
whatever methods iterable<> pulls in that assume the "default iterator" to work
with the indexed case, though (e.g. forEach() would just work, but keys() would
need some changes.

I think this change is fine; people are unlikely to want iterable things with
indexed getters that iterate something other than the indices, and I _really_
hope people don't start adding maplike/setlike things with indexed getters.

Maybe that hope should even be codified by making that invalid IDL?

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

Received on Monday, 6 October 2014 12:23:55 UTC