Skip to content

Implement Iterator.prototype.find method#1451

Merged
ksh8281 merged 1 commit intoSamsung:masterfrom
2Jaeheon:iterator-find
Jul 2, 2025
Merged

Implement Iterator.prototype.find method#1451
ksh8281 merged 1 commit intoSamsung:masterfrom
2Jaeheon:iterator-find

Conversation

@2Jaeheon
Copy link
Copy Markdown
Contributor

@2Jaeheon 2Jaeheon commented Jul 1, 2025

This pull request introduces the implementation of the Iterator.prototype.find method, aligning with the TC39 Iterator Helpers proposal. Key changes include the addition of the find method to the iterator prototype, its integration into the global object, and updates to the test suite to reflect the new functionality.

Implementation of Iterator.prototype.find:

  • Addition of builtinIteratorFind method: Implemented the logic for Iterator.prototype.find, including validation of the this value and the predicate argument, iteration over the iterator, and handling of abrupt completions. (src/builtins/BuiltinIterator.cpp, src/builtins/BuiltinIterator.cppR191-R245)

  • Integration into the iterator prototype: Registered the find method on the m_iteratorPrototype object with proper property attributes (writable and configurable). (src/builtins/BuiltinIterator.cpp, src/builtins/BuiltinIterator.cppR320-R322)

Test suite updates:

  • Removal of Iterator.prototype.find tests from exclusion list: Marked several Iterator.prototype.find tests as no longer excluded, indicating the feature is now implemented and ready for testing. (tools/test/test262/excludelist.orig.xml, tools/test/test262/excludelist.orig.xmlL505-L529)

@2Jaeheon 2Jaeheon force-pushed the iterator-find branch 3 times, most recently from a16933e to 7003eba Compare July 1, 2025 12:04
@clover2123
Copy link
Copy Markdown
Contributor

Please rebase this patch again 🥲
FYI) clang-format is updated to 20 version, not 18

@2Jaeheon 2Jaeheon force-pushed the iterator-find branch 2 times, most recently from 1d11d53 to 4495803 Compare July 1, 2025 15:04
Signed-off-by: 2jaeheon <jaeheon0826@jbnu.ac.kr>
@2Jaeheon
Copy link
Copy Markdown
Contributor Author

2Jaeheon commented Jul 1, 2025

I checked the history with git reflog and rolled back to a point before multiple clang-related changes were introduced. After that, I rebased and resolved the issue accordingly!

Copy link
Copy Markdown
Contributor

@ksh8281 ksh8281 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Job!

@ksh8281 ksh8281 merged commit 901d29e into Samsung:master Jul 2, 2025
29 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.

3 participants