Jason Orendorff updated the iterator proposal a bit. Thank you Jason.
I'd like to point out an issue with it though.
In our previous discussion I had come to the understanding that the
default iterator would use a private name. The main benefit for using
a private name is to not pollute the property name space.
import iterator from '@iter';
myObject[iterator] = function*() { ... };
If this was the ordinary property, "iterator", it might break existing
code that already use "iterator" in some other way.
var obj = LibraryX.getObject();
obj.iterator().forEach(...);
It also breaks objects as maps since any string can be used as key.
--
erik
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss