Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to wrap iterator with Iterator #337

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lundibundi
Copy link
Member

Previously only objects with Symbol.iterator property were supported.
This makes our Iterator only check for .next function on base
and only perform toIterator if called with iter function.

This is a BREAKING CHANGE.

  • code is properly formatted (npm run fmt)
  • tests are added/updated
  • documentation is updated (npm run doc to regenerate documentation based on comments)
  • description of changes is added under the Unreleased header in CHANGELOG.md

Will update docs and changelog when we reach consensus on this as there are multiple options here.

Previously only objects with Symbol.iterator property were supported.
This makes our Iterator only check for .next function on `base`
and only perform `toIterator` if called with `iter` function.

This is a BREAKING CHANGE.
@lundibundi lundibundi added enhancement semver-major incompatible API changes labels Jun 19, 2020
@lundibundi lundibundi self-assigned this Jun 19, 2020
@lundibundi
Copy link
Member Author

lundibundi commented Jun 19, 2020

Also, while most (all?) Iterators follow the pattern of returning this on [Symbol.iterator]() call on them the spec doesn't mandate that IIUC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement semver-major incompatible API changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant