Marcus Stade (2014-04-07T00:31:23.000Z)
domenic at domenicdenicola.com (2014-04-15T15:38:07.664Z)
In section 25.1.2 of [the spec](http://wiki.ecmascript.org/lib/exe/fetch.php?id=harmony%3Aspecification_drafts&cache=cache&media=harmony:working_draft_ecma-262_edition_6_04-05-14.pdf) it says: > The function returns an object that conforms to the IteratorResult > interface. If a previous call to the next method of an Iterator has > returned an IteratorResult object whose done property is true, then all > subsequent calls to the next method of that object must also return an > IteratorResult object whose done property is true, Are there any practical reasons why the Iterator interface explicitly disallows this? It means that, if you care for conformity, you couldn't do something like have iterators be rewindable <https://gist.github.com/mstade/10012898> or auto-rewinding iterators <https://gist.github.com/mstade/10012933>, or any other kind of iterator that might want to change its state after running it's course once. This also means, again if you care for conformity, that you have to keep making new iterator instances. Unless engines start to actively enforce this, it seems a bit pointless to be that strict.