DisposableStack - JavaScript | MDN

developer.mozilla.org

Tin mới

HTML: Markup language

See all HTML references

Date & time formats

See all HTML guides

CSS: Styling language

See all CSS references

See all CSS guides

Centering an element

JavaScript: Scripting language

Standard built-in objects

Expressions & operators

Statements & declarations

See all JavaScript references

Control flow & error handing

Loops and iteration

Working with objects

See all JavaScript guides

Web APIs: Programming interfaces

Service worker API

Using the Web animation API

Using the Fetch API

Working with the History API

Using the Web speech API

All web technology

Progressive web apps

Learn web development

Getting started modules

Structuring content with HTML module

CSS styling basics module

Dynamic scripting with JavaScript module

Border-image generator

Border-radius generator

Box-shadow generator

Color format converter

disposable resources

A DisposableStack is not exactly a "stack" in terms of its interface. It has several methods for pushing disposers to it, but it has no way to pop one disposer off. Rather, all disposers are popped and executed one-by-on

DisposableStack.prototype.constructor

The constructor function that created the instance object. For DisposableStack instances, the initial value is the DisposableStack constructor.

DisposableStack.prototype.disposed

The constructor function that created the instance object. For DisposableStack instances, the initial value is the DisposableStack constructor.

[Symbol.toStringTag]

The initial value of the [Symbol.toStringTag] property is the string "DisposableStack". This property is used in Object.prototype.toString().

Object.prototype.toString()

The initial value of the [Symbol.toStringTag] property is the string "DisposableStack". This property is used in Object.prototype.toString().

DisposableStack.prototype.adopt()

Registers a value that doesn't implement the disposable protocol to the stack by providing a custom disposer function.

DisposableStack.prototype.defer()

Registers a value that doesn't implement the disposable protocol to the stack by providing a custom disposer function.

DisposableStack.prototype.dispose()

Registers a value that doesn't implement the disposable protocol to the stack by providing a custom disposer function.

DisposableStack.prototype.move()

Registers a value that doesn't implement the disposable protocol to the stack by providing a custom disposer function.

DisposableStack.prototype.use()

Registers a value that doesn't implement the disposable protocol to the stack by providing a custom disposer function.

DisposableStack.prototype[Symbol.dispose]

Registers a value that doesn't implement the disposable protocol to the stack by providing a custom disposer function.

AsyncDisposableStack

Learn how to contribute

This page was last modified on Jul 29, 2025 by MDN contributors.

[Symbol.hasInstance]()

__defineGetter__()

__defineSetter__()