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
725 stars 29 forks source link

Add missing calls to NewDisposeCapability AOs #175

Closed rbuckton closed 3 months ago

rbuckton commented 1 year ago

This adds missing calls to NewDisposeCapability() in the NewFunctionEnvironment() and NewModuleEnvironment() AOs

Fixes #170 Fixes #173

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/175.

rbuckton commented 12 months 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 8 months ago

Why do we store DisposeCapability Records instead of the [[DisposableResourceStack]] List directly?

DisposeCapability is used in all of the algorithms, which are shared between both using/await using and DisposableStack/AsyncDisposableStack. I originally had the list directly on the environment record and on DisposableStack, but the wording was confusing in the algorithms since you normally don't pass environment records and Objects interchangeably, and it was suggested that I instead abstract this through a Record type.

rbuckton commented 8 months ago

@waldemarhorwat, @syg: Could one of you look over this and approve if all seems good?

rbuckton commented 3 months ago

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