montagejs / collections

This package contains JavaScript implementations of common data structures with idiomatic interfaces.
http://www.collectionsjs.com
Other
2.09k stars 185 forks source link

Reimplement Iterator #55

Closed kriskowal closed 10 years ago

kriskowal commented 10 years ago

Based in changes to the iterator specification slated for ECMAScript 6, but extended to pass indicies through on iteration objects.

This reimplementation largely avoids using closures for iterator instances.

Methods of iterators that return new iterators are now conjugated differently, to avoid colliding with the variant that will produce a plain array. For example, zipIterator is now iterateZip.

I have removed the type checks for callbacks. Any object implementing call will suffice.

:warning: This commit introduces backward incompatible changes and should await a major version.

kriskowal commented 10 years ago

Needs documentation. Awaits next major version.

kriskowal commented 10 years ago

This has been merged into the branch for upcoming v2, but if @aadsm would like to inspect it, I can leave it open. This does not impact Montage.

aadsm commented 10 years ago

LGTM