RESOLVED FIXED279876
[JSC] Iterator Helpers methods should not iterate an array
https://bugs.webkit.org/show_bug.cgi?id=279876
Summary [JSC] Iterator Helpers methods should not iterate an array
Sosuke Suzuki
Reported 2024-09-18 01:19:13 PDT
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
Sosuke Suzuki
Comment 1 2024-09-18 01:20:05 PDT
EWS
Comment 2 2024-09-19 10:56:39 PDT
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
Comment 3 2024-09-19 10:57:14 PDT
Note You need to log in before you can comment on or make changes to this bug.