Skip to content

use normal completions in ACs passed to CreateIteratorFromClosure when possible #3602

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

michaelficarra
Copy link
Member

CreateIteratorFromClosure passes the AC to GeneratorStart which treats any normal completion return value the same as a ReturnCompletion(*undefined*). It seems better to me to use NormalCompletion(~unused~) in these locations and only return a return completion if we want to use a value other than *undefined*.

@michaelficarra michaelficarra requested a review from a team May 15, 2025 00:25
@michaelficarra michaelficarra added editorial change completion records Relates to completion records, and ? / ! notation. labels May 15, 2025
@bakkot
Copy link
Contributor

bakkot commented May 15, 2025

I don't like that we have this degree of freedom. We should pick one and stick with it, and ensure the machinery only supports that kind. I'll prepare some PRs so we can see what the machinery would look like in each case.

@bakkot
Copy link
Contributor

bakkot commented May 15, 2025

PRs: #3605 / #3606.

I didn't do the actual changes to the ACs; that can wait until we decide which way we want to go. My preference is #3606.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completion records Relates to completion records, and ? / ! notation. editorial change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants