Skip to content

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

Closed
@ShenHongFei

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions