Skip to content

[JSC] Update iterator built-ins to reflect the change of github:tc39/ecma262#3776#65174

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
tetsuharuohzeki:bug-315085-update-iterator-builtins-ecma262-3776
Jun 16, 2026
Merged

[JSC] Update iterator built-ins to reflect the change of github:tc39/ecma262#3776#65174
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
tetsuharuohzeki:bug-315085-update-iterator-builtins-ecma262-3776

Conversation

@tetsuharuohzeki

@tetsuharuohzeki tetsuharuohzeki commented May 19, 2026

Copy link
Copy Markdown
Member

8310ec8

[JSC] Update iterator built-ins to reflect the change of github:tc39/ecma262#3776
https://bugs.webkit.org/show_bug.cgi?id=315085

Reviewed by Yusuke Suzuki.

The change of tc39/ecma262#3776 for iterator helper builtins are categorized into:

- Our implementations should be changed due to they should throw a `RangeError` corresponds to the user input value.
    - `Iterator.prototype.drop`
    - `Iterator.prototype.take`
- The semantics has been a bit changed but it's not related to our implementation actually.
    - `Iterator.prototype.filter`
    - `Iterator.prototype.find`
    - `Iterator.prototype.flatMap`
    - `Iterator.prototype.forEach`
    - `Iterator.prototype.map`
    - `Iterator.prototype.reduce`
    - `Iterator.prototype.some`

Tests: JSTests/stress/iterator-prototype-drop-bug315085.js
       JSTests/stress/iterator-prototype-take-bug315085.js

* JSTests/stress/iterator-prototype-drop-bug315085.js: Added.
    https://commits.webkit.org/284597@main implements `Iterator.prototype.drop`
    but no stress tests. This change adds a minimum testcase.
* JSTests/stress/iterator-prototype-take-bug315085.js: Added.
    https://commits.webkit.org/284597@main implements `Iterator.prototype.take`
    but no stress tests. This change adds a minimum testcase.
* Source/JavaScriptCore/builtins/JSIteratorPrototype.js:

Canonical link: https://commits.webkit.org/315276@main

21c29a4

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
✅ 🛠 🧪 jsc-x86-64 ✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 🧪 jsc-debug-arm64 ✅ 🛠 ios-safer-cpp ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress 🛠 playstation
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 jsc-armv7
✅ 🛠 tv ✅ 🛠 mac-safer-cpp ✅ 🧪 jsc-armv7-tests
✅ 🛠 tv-sim ✅ 🧪 mac-site-isolation
✅ 🛠 watch
✅ 🛠 watch-sim

@tetsuharuohzeki tetsuharuohzeki self-assigned this May 19, 2026
@tetsuharuohzeki tetsuharuohzeki added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label May 19, 2026
@tetsuharuohzeki

Copy link
Copy Markdown
Member Author

test262 still not contains the test of tc39/ecma262#3776 yet...

@tetsuharuohzeki tetsuharuohzeki force-pushed the bug-315085-update-iterator-builtins-ecma262-3776 branch from f7a97e4 to ab8c522 Compare May 21, 2026 09:24
@tetsuharuohzeki tetsuharuohzeki changed the title [JSC] Update iterator built-ins to reflect the change of github:tc39/ecma262#3776 fixup! [JSC] Update iterator built-ins to reflect the change of github:tc39/ecma262#3776 https://bugs.webkit.org/show_bug.cgi?id=315085 May 21, 2026
@tetsuharuohzeki tetsuharuohzeki changed the title fixup! [JSC] Update iterator built-ins to reflect the change of github:tc39/ecma262#3776 https://bugs.webkit.org/show_bug.cgi?id=315085 [JSC] Update iterator built-ins to reflect the change of github:tc39/ecma262#3776 May 21, 2026
@tetsuharuohzeki tetsuharuohzeki force-pushed the bug-315085-update-iterator-builtins-ecma262-3776 branch from 1c859ae to 8167400 Compare May 21, 2026 10:03
@tetsuharuohzeki

Copy link
Copy Markdown
Member Author

test262 still not contains the test of tc39/ecma262#3776 yet...

I opened tc39/test262#5059

@tetsuharuohzeki tetsuharuohzeki force-pushed the bug-315085-update-iterator-builtins-ecma262-3776 branch from 8167400 to 4a33091 Compare May 21, 2026 13:55
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 21, 2026
@tetsuharuohzeki tetsuharuohzeki removed the merging-blocked Applied to prevent a change from being merged label May 22, 2026
@tetsuharuohzeki tetsuharuohzeki force-pushed the bug-315085-update-iterator-builtins-ecma262-3776 branch from 4a33091 to 4c3cf85 Compare May 22, 2026 10:03
@tetsuharuohzeki tetsuharuohzeki force-pushed the bug-315085-update-iterator-builtins-ecma262-3776 branch from 4c3cf85 to b3d173d Compare May 31, 2026 23:17
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 1, 2026
@tetsuharuohzeki tetsuharuohzeki removed the merging-blocked Applied to prevent a change from being merged label Jun 1, 2026
@tetsuharuohzeki tetsuharuohzeki force-pushed the bug-315085-update-iterator-builtins-ecma262-3776 branch from b3d173d to fdb57de Compare June 1, 2026 10:45
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jun 1, 2026
@tetsuharuohzeki tetsuharuohzeki removed the merging-blocked Applied to prevent a change from being merged label Jun 2, 2026
@tetsuharuohzeki tetsuharuohzeki marked this pull request as ready for review June 2, 2026 05:13
@tetsuharuohzeki tetsuharuohzeki requested a review from a team as a code owner June 2, 2026 05:13
@tetsuharuohzeki tetsuharuohzeki force-pushed the bug-315085-update-iterator-builtins-ecma262-3776 branch from fdb57de to 21c29a4 Compare June 2, 2026 09:55
@tetsuharuohzeki tetsuharuohzeki added the request-merge-queue Request a pull request to be added to merge-queue once ready label Jun 4, 2026
@Ahmad-S792 Ahmad-S792 added merge-queue Applied to send a pull request to merge-queue and removed request-merge-queue Request a pull request to be added to merge-queue once ready labels Jun 16, 2026
…ecma262#3776

https://bugs.webkit.org/show_bug.cgi?id=315085

Reviewed by Yusuke Suzuki.

The change of tc39/ecma262#3776 for iterator helper builtins are categorized into:

- Our implementations should be changed due to they should throw a `RangeError` corresponds to the user input value.
    - `Iterator.prototype.drop`
    - `Iterator.prototype.take`
- The semantics has been a bit changed but it's not related to our implementation actually.
    - `Iterator.prototype.filter`
    - `Iterator.prototype.find`
    - `Iterator.prototype.flatMap`
    - `Iterator.prototype.forEach`
    - `Iterator.prototype.map`
    - `Iterator.prototype.reduce`
    - `Iterator.prototype.some`

Tests: JSTests/stress/iterator-prototype-drop-bug315085.js
       JSTests/stress/iterator-prototype-take-bug315085.js

* JSTests/stress/iterator-prototype-drop-bug315085.js: Added.
    https://commits.webkit.org/284597@main implements `Iterator.prototype.drop`
    but no stress tests. This change adds a minimum testcase.
* JSTests/stress/iterator-prototype-take-bug315085.js: Added.
    https://commits.webkit.org/284597@main implements `Iterator.prototype.take`
    but no stress tests. This change adds a minimum testcase.
* Source/JavaScriptCore/builtins/JSIteratorPrototype.js:

Canonical link: https://commits.webkit.org/315276@main
@webkit-commit-queue webkit-commit-queue force-pushed the bug-315085-update-iterator-builtins-ecma262-3776 branch from 21c29a4 to 8310ec8 Compare June 16, 2026 10:00
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 315276@main (8310ec8): https://commits.webkit.org/315276@main

Reviewed commits have been landed. Closing PR #65174 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 8310ec8 into WebKit:main Jun 16, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 16, 2026
@tetsuharuohzeki tetsuharuohzeki deleted the bug-315085-update-iterator-builtins-ecma262-3776 branch June 16, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants