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

Add for-of fallback for arrays in browsers without symbol support #11263

Merged
merged 4 commits into from Mar 19, 2020

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Mar 14, 2020

Q                       A
Patch: Bug Fix? Yes?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

This is similar to the assumeArray option: it makes arrays work in browsers without Symbol support. It's safe to apply this by default, because for non-arrays it still goes in the Symbol.iterator path.

This PR isn't really useful per se, but it's needed for Part 3 of this series.

Part 2/n

Depends on:

@nicolo-ribaudo nicolo-ribaudo added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Mar 14, 2020
@nicolo-ribaudo nicolo-ribaudo added this to Blocked in Iterables DX Mar 15, 2020
@nicolo-ribaudo nicolo-ribaudo force-pushed the iterables-dx/for-of-no-symbol-allow-array branch from d5b9ea3 to fe088fe Compare March 17, 2020 01:06
@nicolo-ribaudo nicolo-ribaudo changed the base branch from iterables-dx/for-of-helper to master March 17, 2020 01:07
@nicolo-ribaudo nicolo-ribaudo marked this pull request as ready for review March 17, 2020 01:08
@nicolo-ribaudo nicolo-ribaudo moved this from Blocked to Ready for review in Iterables DX Mar 17, 2020
if (i >= o.length) return { done: true };
return { done: false, value: o[i++] };
},
e: F,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This e method needs to throw the passed in error.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good catch!

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jun 18, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 18, 2020
@nicolo-ribaudo nicolo-ribaudo deleted the iterables-dx/for-of-no-symbol-allow-array branch June 18, 2020 23:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
No open projects
Iterables DX
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants