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

Explicit resource management tc39 proposal #7316

Closed
arcanis opened this issue Apr 22, 2023 · 1 comment · Fixed by #7376
Closed

Explicit resource management tc39 proposal #7316

arcanis opened this issue Apr 22, 2023 · 1 comment · Fixed by #7376
Assignees
Milestone

Comments

@arcanis
Copy link

arcanis commented Apr 22, 2023

Describe the feature

The feature described at https://github.com/tc39/proposal-explicit-resource-management is now stage 3, and is planned for inclusion in TypeScript 5.2: microsoft/TypeScript#53031 (comment)

It turns the following:

function foo() {
  using handler = createWasmObject();
  handler.doSomething();
}

Into a more complex version of something akin to:

function foo() {
  const handler = createWasmObject();
  try {
    handler.doSomething();
  } finally {
    handler[Symbol.dispose]();
  }
}

Babel plugin or link to the feature description

https://github.com/tc39/proposal-explicit-resource-management

Additional context

No response

@kdy1 kdy1 self-assigned this Apr 23, 2023
@kdy1 kdy1 added this to the Planned milestone Apr 23, 2023
kdy1 added a commit that referenced this issue May 10, 2023
**Description:**

 - Add `UsingDecl`.
 - Add `UsingDecl` to `Decl`.
 - Rename `VarDeclOrPat` to `ForHead`.
 - Add `UsingDecl` to `ForHead`.
 - Implement parser for using declarations.

**Related issue:**

 - #7316.
kdy1 added a commit that referenced this issue Jun 29, 2023
@kdy1 kdy1 modified the milestones: Planned, v1.3.68 Jul 5, 2023
@swc-bot
Copy link
Collaborator

swc-bot commented Aug 4, 2023

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Aug 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

3 participants