Skip to content

Conversation

rbuckton
Copy link
Collaborator

@rbuckton rbuckton commented Jun 27, 2023

This fixes an oversight in ForIn/OfBodyEvaluation to correctly use the hint variable initialized at the top of the algorithm when initializing the lhsRef binding via InitializeReferencedBinding. This is necessary to correctly initialize a resource that uses Symbol.asyncDispose in the following statement:

for (await using x of y) {
}

Fixes #172

cc: @tc39/ecma262-editors

@rbuckton rbuckton requested review from syg and waldemarhorwat June 27, 2023 17:11
@github-actions
Copy link

A preview of this PR can be found at https://tc39.es/proposal-explicit-resource-management/pr/171.

@rbuckton rbuckton changed the title Correctly use _hint_ in ForIn/OfBodyEvaluation Correctly use hint in ForIn/OfBodyEvaluation Jun 27, 2023
@rbuckton rbuckton added the needs-consensus A pull request that needs consensus at TC39 plenary label Jun 27, 2023
@rbuckton
Copy link
Collaborator Author

This was approved by consensus at the July, 2023 TC39 Plenary, but still needs reviews from the editors and reviewers before I can merge.

@waldemarhorwat, @syg, @michaelficarra, @bakkot: can you please review?

@rbuckton rbuckton added the has-consensus Indicates a pull request reached consensus at TC39 plenary. label Jul 13, 2023
@rbuckton rbuckton added this to the Stage 4 milestone Jul 19, 2023
@rbuckton
Copy link
Collaborator Author

rbuckton commented Nov 7, 2023

@waldemarhorwat, @syg: can you take a look at this? I have an approval from an editor but I'd like to get signoff from a reviewer before merging.

@rbuckton rbuckton merged commit e53b73f into main Mar 20, 2024
@rbuckton rbuckton deleted the use-hint-in-ForInOfBodyEvaluation branch March 20, 2024 19:24
@rbuckton
Copy link
Collaborator Author

This has already been merged into rbuckton/ecma262#3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-consensus Indicates a pull request reached consensus at TC39 plenary. needs-consensus A pull request that needs consensus at TC39 plenary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect usage of InitializeReferencedBinding AO in ForIn/OfBodyEvaluation
2 participants