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

[Bug 26183] make it easier to define an iterator on an interface that iterates over a set of values

From: <bugzilla@jessica.w3.org>
Date: Sat, 04 Oct 2014 12:27:14 +0000
To: public-script-coord@w3.org
Message-ID: <bug-26183-3890-oxo8HbJuc1@http.www.w3.org/Bugs/Public/>

--- Comment #36 from Cameron McCormack <cam@mcc.id.au> ---
(In reply to Domenic Denicola from comment #34)
> Reviewing...
> The setlike looks a bit strange, since it allows two types. It should only
> allow one type, I think. ES (for some reason) has keys() -> Iterable<T>,
> values() -> Iterable<T>, and entries() -> Iterable<[T, T]>, but it's the
> same T always.

Yeah, copy-paste error in the green block there and in the following paragraph.
 (Which is odd because I remember taking care of that; must have lost some
edits while git stashing.)  Fixed:

> In the @@iterator definitions, you use CreateMapIterator and friends
> directly on the objects, but the objects do not have [[MapData]] internal
> slots, so this will immediately fail. I don't know how to solve this though,
> since if you put [[MapData]] on the object then you can use
> Map.prototype.set.call(obj, "bypassed your typechecking haha"). Maybe you
> could forward to [[BackingMap]].@@iterator? You have to be careful not to
> allow anyone access to [[BackingMap]] somehow.

Yes my intention was to grab the [[BackingMap]] and call CreateMapIterator with
that but I guess I forgot here.  Fixed:

> It is probably implicit, but I don't see anywhere that explicitly does type
> conversion on arguments passed to the forwarding functions. Am I correct in
> assuming this happens implicitly because they are WebIDL methods instead of
> JS methods? Or is this missing?

No, it's missing.  Added (at the expense of expanding this section out some

> Overall this looks pretty nice. Very batteries-included.


You are receiving this mail because:
You are on the CC list for the bug.
Received on Saturday, 4 October 2014 12:27:16 UTC

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