Add ES2015 Iterator return() method foundation#2079
Closed
anivar wants to merge 1 commit intomozilla:masterfrom
Closed
Add ES2015 Iterator return() method foundation#2079anivar wants to merge 1 commit intomozilla:masterfrom
anivar wants to merge 1 commit intomozilla:masterfrom
Conversation
595fe43 to
0fca600
Compare
Implements the IteratorClose abstract operation from ES2015 spec section 7.4.6 as foundation for issue mozilla#1409 - ES2015 Iterator protocol return() method not called. Added: - ScriptRuntime.iteratorClose(): Core method implementing IteratorClose operation - ScriptRuntime.performIteratorClose(): Helper method for actual iterator cleanup - IteratorCloseTest: Unit tests for the foundation methods - IteratorReturnTest: Integration tests (currently expected to fail) - Updated test262.properties with current test baselines The foundation methods correctly implement the ES2015 specification but are not yet integrated into for-of loop control flow. This requires architectural changes to properly track loop boundaries and intercept abnormal loop exits (break/throw/return). Current test262 for-of status remains 438/751 (58.32%) as expected for foundational work.
0fca600 to
3448c39
Compare
Contributor
Author
|
Closing this PR for now. The Iterator return() method foundation work will be revisited after the ES2025 Iterator implementation in #2078 is complete. The current approach in #2078 with feature flags provides a cleaner migration path, and the iterator protocol's return() method (for for-of loop cleanup) is a separate concern from the ES2025 Iterator helpers. The CI failures also indicate this needs more work:
Will create a fresh PR for iterator return() support once the ES2025 Iterator foundation is merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the IteratorClose abstract operation from ES2015 spec section 7.4.6 as foundation work towards issue #1409.
Changes Added
Current Status
Foundation methods implemented correctly per ES2015 spec. Unit tests pass - core functionality verified. Integration incomplete - requires control flow changes.
The foundation is solid. Full implementation needs architectural discussion on #1409 for proper integration with for-of loop control flow (break/throw/return scenarios).
Test Results
Related to #1409