Patch es6 iterators not having Symbol.iterator function #479
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #249
This should probably be fixed in Clojurescript itself but I'm out of my depth here already (I am a Clojure noob).
We can't do
(es6-iterable ES6Iterator)because that would be infinite recursion so we patch theES6Iteratorprototype with theSymbol.iteratordirectly, sans recursion.Interestingly enough
cljs.core/keysalready returns aKeySeqwhich hasSymbol.iteratorbut nonextfunction. Applyinges6-iterator, as we do, seems give it thenextfunction but stripSymbol.iterator.This doesn't yet fix[...e]because I'm not quite sure what the intention there is, I guess the same as[...e.entries()]?