iterator as a unique *symbol* and the enumerate trap

David Bruant bruant.d at gmail.com
Mon Oct 1 04:08:04 PDT 2012


s/name/symbol, obviously :-)

2012/10/1 David Bruant <bruant.d at gmail.com>

> Hi,
>
> If I'm following properly, iterate is now a unique name that can be used
> on any object as per July 24 meeting notes [1]. It led the decision to
> remove the iterate trap on proxies [2]:
> "Removed ''iterate()'' trap as iterators can be defined on any old object
> via an ''iterate'' unique name. See discussion at [[harmony:iterators]]. A
> proxy will intercept the request for its iterator via the ''get'' trap,
> which is passed the unique ''iterator'' name as argument."
>
> What about making "enumerator" a unique name and remove the enumerate trap
> too?
> Proxies that want to redefine the behavior of for-in loop can just decide
> to return a different iterator than the target one.
>
> David
>
> [1] https://mail.mozilla.org/pipermail/es-discuss/2012-July/024207.html
> [2]
> http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxies#open_issues
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121001/eb0b0c9f/attachment.html>


More information about the es-discuss mailing list