Skip to content

support using / await using (explicit resource management) #1367

Description

@ShenHongFei
{
    using resource = {
        [Symbol.dispose] () {
            console.log('dispose')
        }
    }
}
// output: dispose

Node.js and browsers already natively support and can use this syntax.

https://v8.dev/features/explicit-resource-management

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

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html

nodejs/node#58467

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions