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

Switch wasm-bindgen bindings to Symbol.dispose #804

Merged
merged 1 commit into from
May 18, 2024

Commits on May 18, 2024

  1. Switch wasm-bindgen bindings to Symbol.dispose

    There is a [JavaScript
    proposal](https://github.com/tc39/proposal-explicit-resource-management)
    for using `Symbol.dispose` as a way to automatically clean up resources.
    You do that by declaring variables like so:
    ```js
    using resource = new Resource();
    ```
    The variable `x` will be automatically disposed when it goes out of
    scope. We used to have our own `dispose` method and `with` helper method
    that allows scoped access to the resource, before it gets cleaned up at
    the end. TypeScript already fully implements and polyfills support for
    it, so we can already fully switch over to it.
    CryZe committed May 18, 2024
    Configuration menu
    Copy the full SHA
    b9b1bf5 View commit details
    Browse the repository at this point in the history