Skip to content
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

Add PromiseCapability wrapper around sync dispose used in an await using #218

Merged
merged 2 commits into from Apr 10, 2024

Conversation

rbuckton
Copy link
Collaborator

Per discussion in #216 (comment), this adds a PromiseCapability to the wrapper function created around a @@dispose method read by an await using declaration to ensure that any errors thrown by @@dispose are not thrown synchronously. This is in keeping with the mechanism used in %AsyncFromSyncIteratorPrototype%.next().

@rbuckton rbuckton added needs-consensus A pull request that needs consensus at TC39 plenary normative Indicates a normative change to the specification labels Mar 22, 2024
Copy link

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

Copy link

@syg syg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editorially lgtm.

@rbuckton rbuckton added the has-consensus Indicates a pull request reached consensus at TC39 plenary. label Apr 10, 2024
@rbuckton rbuckton merged commit ddd0795 into main Apr 10, 2024
1 check passed
@rbuckton rbuckton deleted the async-from-sync-dispose branch April 10, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has-consensus Indicates a pull request reached consensus at TC39 plenary. needs-consensus A pull request that needs consensus at TC39 plenary normative Indicates a normative change to the specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants