Visitar URL original
Fix `String` wrapper creation in `Iterator.from` by arcde40 · Pull Request #1589 · zloirock/core-js · GitHub
Skip to content

Fix String wrapper creation in Iterator.from - #1589

Merged
zloirock merged 2 commits into
zloirock:masterfrom
arcde40:fix/iterator-from-string-wrapper
Nov 12, 2026
Merged

zloirock merged 2 commits into
zloirock:masterfrom
arcde40:fix/iterator-from-string-wrapper

Conversation

@arcde40

@arcde40 arcde40 commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Iterator.from converts string primitives with toObject, which differs from the spec and fails test262 built-ins/Iterator/from/iterable-primitives.js.

getIteratorFlattenable already handles string primitives when stringHandling is true, so the toObject call can be removed.

`getIteratorFlattenable` already handles string primitives, so `toObject` is unnecessary.
@zloirock

Copy link
Copy Markdown
Owner

Could you add a test case for the scenario that was causing a failure?

@arcde40

arcde40 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Sure! Added tests to both unit-global and unit-pure, adapted from the test262 case. They fail without the fix and pass with it.

@zloirock

Copy link
Copy Markdown
Owner

Thanks.

@zloirock
zloirock merged commit fd0c775 into zloirock:master Nov 12, 2026
28 checks passed
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.

2 participants