Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: add Iterator Helpers #3395

Merged
merged 1 commit into from
Oct 20, 2024
Merged

Normative: add Iterator Helpers #3395

merged 1 commit into from
Oct 20, 2024

Conversation

michaelficarra
Copy link
Member

@michaelficarra michaelficarra added normative change Affects behavior required to correctly evaluate some ECMAScript source text pending stage 4 This proposal has not yet achieved stage 4, but may otherwise be ready to merge. proposal This is related to a specific proposal, and will be closed/merged when the proposal reaches stage 4. labels Aug 16, 2024
@@ -6956,6 +6996,28 @@ <h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-getiteratorflattenable" type="abstract operation">
<h1>
GetIteratorFlattenable (
Copy link
Member Author

Choose a reason for hiding this comment

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

I would love to come up with a better name for this AO.

Copy link
Member Author

Choose a reason for hiding this comment

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

This comment was about GetIteratorFlattenable (it's no longer displaying under the appropriate line in the diff view).

Copy link
Member

Choose a reason for hiding this comment

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

looks right on the conversation view, at least

@jmdyck

This comment was marked as resolved.

jmdyck
jmdyck previously requested changes Aug 20, 2024
spec.html Outdated Show resolved Hide resolved
spec.html Show resolved Hide resolved
spec.html Outdated Show resolved Hide resolved
spec.html Show resolved Hide resolved
spec.html Show resolved Hide resolved
spec.html Show resolved Hide resolved
spec.html Show resolved Hide resolved
@michaelficarra michaelficarra force-pushed the iterator-helpers-integration branch 2 times, most recently from 2255ce1 to 0cb2376 Compare September 5, 2024 00:03
@michaelficarra
Copy link
Member Author

FYI we're having a relevant editorial discussion here: tc39/proposal-joint-iteration#30

@michaelficarra michaelficarra force-pushed the iterator-helpers-integration branch 2 times, most recently from 322876c to 380047c Compare September 23, 2024 21:10
spec.html Show resolved Hide resolved
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

This PR seems to be missing changes to CreateIteratorFromClosure to add a 4th argument? (present in the proposal spec)

spec.html Show resolved Hide resolved
spec.html Show resolved Hide resolved
@michaelficarra michaelficarra added has stage 4 This PR represents a proposal that has achieved stage 4, and is ready to merge. and removed pending stage 4 This proposal has not yet achieved stage 4, but may otherwise be ready to merge. labels Oct 8, 2024
@michaelficarra
Copy link
Member Author

@tc39/ecma262-editors Do we want to make the [[UnderlyingIterator]] internal slot plural (as is required by upcoming proposal joint iteration) as part of this PR, or should we do it in 2 phases?

@michaelficarra michaelficarra added the editor call to be discussed in the next editor call label Oct 10, 2024
Copy link
Contributor

@bakkot bakkot left a comment

Choose a reason for hiding this comment

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

LGTM. I no longer think we should rename [[UnderlyingIterators]] now, since it would also involve changing its handling; we can do that in the followup.

@michaelficarra michaelficarra added ready to merge Editors believe this PR needs no further reviews, and is ready to land. and removed editor call to be discussed in the next editor call labels Oct 17, 2024
1. If _O_.[[GeneratorState]] is ~suspended-start~, then
1. Set _O_.[[GeneratorState]] to ~completed~.
1. NOTE: Once a generator enters the completed state it never leaves it and its associated execution context is never resumed. Any execution state associated with _O_ can be discarded at this point.
1. Perform ? IteratorClose(_O_.[[UnderlyingIterator]], ReturnCompletion(*undefined*)).
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems like this Return Completion could be returned by IteratorClose, and thus by this algorithm, and thus by the [[Call]] for this built-in. But the invariants for essential internal methods don't allow [[Call]] to return a Return Completion.

Co-authored-by: Michael Ficarra <[email protected]>
Co-authored-by: Michael Dyck <[email protected]>
@ljharb ljharb force-pushed the iterator-helpers-integration branch from 60fcae2 to 961f269 Compare October 20, 2024 21:29
@ljharb ljharb dismissed jmdyck’s stale review October 20, 2024 21:45

changes addressed

@ljharb ljharb merged commit 961f269 into main Oct 20, 2024
9 checks passed
@ljharb ljharb deleted the iterator-helpers-integration branch October 20, 2024 21:45
@michaelficarra michaelficarra added the editor call to be discussed in the next editor call label Oct 21, 2024
@bakkot bakkot removed the editor call to be discussed in the next editor call label Oct 23, 2024
domenic added a commit to whatwg/webidl that referenced this pull request Oct 28, 2024
domenic added a commit to whatwg/webidl that referenced this pull request Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has stage 4 This PR represents a proposal that has achieved stage 4, and is ready to merge. normative change Affects behavior required to correctly evaluate some ECMAScript source text proposal This is related to a specific proposal, and will be closed/merged when the proposal reaches stage 4. ready to merge Editors believe this PR needs no further reviews, and is ready to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants