mori
mori copied to clipboard
ES2015 iterator support not really provided
The following sentence from the mori website is currently not really true: "All Mori collections support ES6 iteration via foo[Symbol.iterator] or foo['@@iterator']"
mori.list(1, 2, 3)['@@iterator'] returns undefined.
See also: http://jsfiddle.net/4utqrsta
JSFiddle is ES5, so of course it doesn't work there. You would need to bring in something like Babel to start seeing those features work. That said, you're still correct that it's undefined even in an ES6 context.
After fixing it to Symbol.iterator instead of '@@iterator', I can still confirm.
looks like closure compiler is messing with that. in 0.3.2 I found setting
list[Symbol.iterator] = list.prototype['undefined']
clears seem to work