tc39 / proposal-explicit-resource-management

ECMAScript Explicit Resource Management
https://arai-a.github.io/ecma262-compare/?pr=3000
BSD 3-Clause "New" or "Revised" License
758 stars 30 forks source link

Correctly use hint in ForIn/OfBodyEvaluation #171

Closed rbuckton closed 6 months ago

rbuckton commented 1 year ago

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

github-actions[bot] commented 1 year ago

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

rbuckton commented 1 year ago

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 commented 11 months ago

@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 commented 6 months ago

This has already been merged into https://github.com/rbuckton/ecma262/pull/3