Michał Wadas wrote:
First possible problem - "of" used in if statement can put iterator in
unexpected state or result in arbitrary side effects.
What iterator?
First, you shouldn't assume this would be based on the Symbol.iterator
protocol. I wrote something like @@hasInstance for instanceof was the
precedent to follow.
Second, the iteration protocol would require exhaustively searching for
values. Side effects of iteration are the least worry!
Finally, even if the iteration protocol were used, there would be no
shared/reused iterator. You get a fresh one from well-implemented iterables.
/be
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss