Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

Symbol.asyncDispose

2 tags 1 category

The Symbol.asyncDispose static data property represents the well-known symbol Symbol.asyncDispose. The await using declaration looks up this symbol on the variable initializer for the method to call when the variable goes out of scope.

An object is async disposable if it has the Symbol.asyncDispose method. The method is expected to have the following semantics:

Invoking this method notifies the AsyncDisposable object that the caller does not intend to continue to use this object. This method should perform any necessary logic to explicit clean up the resource including, but not limited to, file system handles, streams, host objects, etc. This method can return a promise, which will be awaited before continuing. When an exception is thrown from this method, it typically means that the resource could not be explicitly freed. An AsyncDisposable object is not considered “disposed” until the resulting Promise has been fulfilled. If called more than once on the same object, the function should not throw an exception. However, this requirement is not enforced.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…