paulmillr / es6-shim

ECMAScript 6 compatibility shims for legacy JS engines
http://paulmillr.com
MIT License
3.11k stars 388 forks source link

Make shimmed ArrayIterator private. #255

Closed cscott closed 10 years ago

cscott commented 10 years ago

Closes #252

DylanLukes commented 10 years ago

This should also apply to MapIterator, SetIterator, and so forth.

None of these have public constructors per spec.

cscott commented 10 years ago

Nor do they in the current implementation. ArrayIterator was added in cb08baddc682a69435f48e9d6de2db094d9d51f1 before I got involved, which is the only reason it was public.

ljharb commented 10 years ago

(sick miniburn @cscott)

cscott commented 10 years ago

That said, there have been at least two revisions of the ES6 spec since I wrote the iterator code, so it is possible that we will find some divergences. I certainly don't want to discourage anyone from looking for them! Please do double-check the code and find something fixable so you can make me look foolish. ;)