We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
using
@@dispose
The idea is that this...
class C { using a = foo(); using #b = bar(); await using c = baz(); await using #d = thing(); }
...is sugar for (roughly) this:
class C { a = foo(); #b = bar(); c = baz(); #d = thing(); [Symbol.dispose]() { try { this.a[Symbol.dispose]() } finally { this.#b[Symbol.dispose]() } } async [Symbol.asyncDispose]() { try { await this.c[Symbol.asyncDispose]() } finally { await this.#d[Symbol.asyncDispose]() } } }
It'd make collections of named disposable things a lot easier to work with.
Obviously intended as a follow-on proposal, so feel free to label accordingly.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The idea is that this...
...is sugar for (roughly) this:
It'd make collections of named disposable things a lot easier to work with.
Obviously intended as a follow-on proposal, so feel free to label accordingly.
The text was updated successfully, but these errors were encountered: