This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
fixes #163: close both iterators in flatMap #195
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -643,8 +643,11 @@ <h1>Iterator.prototype.flatMap ( _mapper_ )</h1> | |||||||||
1. Else, | ||||||||||
1. Let _innerValue_ be Completion(IteratorValue(_innerNext_)). | ||||||||||
1. IfAbruptCloseIterator(_innerValue_, _iterated_). | ||||||||||
1. Let _yielded_ be Completion(Yield(_innerValue_)). | ||||||||||
1. IfAbruptCloseIterator(_yielded_, _iterated_). | ||||||||||
1. Let _completion_ be Completion(Yield(_innerValue_)). | ||||||||||
1. If _completion_ is an abrupt completion, then | ||||||||||
1. Let _backupCompletion_ be Completion(IteratorClose(_innerIterator_, _completion_)). | ||||||||||
1. IfAbruptCloseIterator(_backupCompletion_, _iterated_). | ||||||||||
1. Return ? IteratorClose(_completion_, _iterated_). | ||||||||||
1. Return CreateIteratorFromClosure(_closure_, ~Iterator Helper~, %IteratorHelperPrototype%). | ||||||||||
</emu-alg> | ||||||||||
</emu-clause> | ||||||||||
|
@@ -903,8 +906,14 @@ <h1>AsyncIterator.prototype.flatMap ( _mapper_ )</h1> | |||||||||
1. Else, | ||||||||||
1. Let _innerValue_ be Completion(IteratorValue(_innerNext_)). | ||||||||||
1. IfAbruptCloseAsyncIterator(_innerValue_, _iterated_). | ||||||||||
1. Let _yielded_ be Completion(Yield(_innerValue_)). | ||||||||||
1. IfAbruptCloseAsyncIterator(_yielded_, _iterated_). | ||||||||||
1. [id="step-async-iterator-flatmap-yield"] Let _completion_ be Completion(Yield(_innerValue_)). | ||||||||||
1. If _completion_ is a return completion, then | ||||||||||
1. Let _backupCompletion_ be Completion(IteratorClose(_innerIterator_, _completion_)). | ||||||||||
1. IfAbruptCloseIterator(_backupCompletion_, _iterated_). | ||||||||||
Comment on lines
+911
to
+912
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
1. Return ? IteratorClose(_completion_, _iterated_). | ||||||||||
1. Else if _completion_ is a throw completion, then | ||||||||||
1. Assert: Awaiting _innerValue_ during the Yield on step <emu-xref href="#step-async-iterator-flatmap-yield"></emu-xref> threw. | ||||||||||
1. Return ? IteratorClose(_completion_, _iterated_). | ||||||||||
1. Return CreateAsyncIteratorFromClosure(_closure_, ~Async Iterator Helper~, %AsyncIteratorHelperPrototype%). | ||||||||||
</emu-alg> | ||||||||||
</emu-clause> | ||||||||||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.