Closed rbuckton closed 3 months ago
A preview of this PR can be found at https://tc39.es/proposal-explicit-resource-management/pr/175.
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?
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.
@waldemarhorwat, @syg: Could one of you look over this and approve if all seems good?
This has already been merged into https://github.com/rbuckton/ecma262/pull/3
This adds missing calls to
NewDisposeCapability()
in theNewFunctionEnvironment()
andNewModuleEnvironment()
AOsFixes #170 Fixes #173
cc: @tc39/ecma262-editors