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

support String parameters in Iterator.from and AsyncIterator.from #250

Merged
merged 1 commit into from Dec 1, 2022

Conversation

michaelficarra
Copy link
Member

As agreed upon in committee today as a condition for stage 3 advancement. Fixes #244.

@michaelficarra michaelficarra mentioned this pull request Dec 1, 2022
@michaelficarra michaelficarra merged commit 05b0c26 into main Dec 1, 2022
1 check passed
@michaelficarra michaelficarra deleted the from-strings branch December 1, 2022 12:16
@zloirock
Copy link
Contributor

zloirock commented Dec 1, 2022

It's strange to limit it only to strings - why not ToObject for everything? Upcoming proposals will have other iterable primitives / non-objects. For example, Typles. In some cases, it could theoretically require forced polyfilling of those .from methods.

@michaelficarra
Copy link
Member Author

michaelficarra commented Dec 1, 2022

We plan to have R&T proposal add support for tuples in GetIteratorFlattenable. Other primitives are much more likely to be an error than intending to be iterated. If a caller really wants to iterate any value, they can accommodate that with a call to Object().

edit: See tc39/proposal-record-tuple#369.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Strings **should** be considered as iterables
3 participants