iterator as a unique name and the enumerate trap

David Bruant bruant.d at
Mon Oct 1 03:45:26 PDT 2012


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
Proxies that want to redefine the behavior of for-in loop can just decide
to return a different iterator than the target one.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list