is an iterator allowed to reuse the same "state" object?

Tab Atkins Jr. jackalmage at
Mon Apr 27 22:29:55 UTC 2015

On Mon, Apr 27, 2015 at 3:11 PM, John Lenz <concavelenz at> wrote:
> By which I mean the object that returns the current value and "done" state?

IIRC, it's not supposed to.  The built-in iterators will return fresh
objects each time, so there's no mutation hazard.  Userland iterators
can of course violate this, but at their peril.


More information about the es-discuss mailing list