Bug 279876
| Summary: | [JSC] Iterator Helpers methods should not iterate an array | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Sosuke Suzuki <aosukeke> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Sosuke Suzuki
We implemented a function called `forEachInIteratorProtocol` to implement
`Iterator.prototype.toArray`[1]. As the name suggests, this function iterates over objects that
conform to the iterator protocol, but it also iterates over fast arrays.
According to the specification, this behavior is unexpected[2].
This patch modifies the `forEachInIteratorProtocol` function to stop iterating over arrays. It also
removes the fast path for fast arrays in `Iterator.prototype.toArray`[3].
[1]: https://commits.webkit.org/283381@main
[2]: https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
[3]: https://commits.webkit.org/283381@main
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Sosuke Suzuki
Pull request: https://github.com/WebKit/WebKit/pull/33816
EWS
Committed 283933@main (ea7b8287cc3f): <https://commits.webkit.org/283933@main>
Reviewed commits have been landed. Closing PR #33816 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/136303997>