DisposableStack.prototype [ @@dispose ] ()
The initial value of the @@dispose property is %DisposableStack.prototype.dispose%, defined in .
@@ -4624,7 +4625,7 @@ contributors: Ron Buckton, Ecma International
a DisposeCapability Record
- Holds the stack of disposable resources.
+ Resources to be disposed when the disposable stack is disposed.
|
@@ -4690,14 +4691,32 @@ contributors: Ron Buckton, Ecma International
does not have an [[AsyncDisposableState]] internal slot or any of the other internal slots of AsyncDisposableStack instances.
-
- get AsyncDisposableStack.prototype.disposed
- `AsyncDisposableStack.prototype.disposed` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:
+
+ AsyncDisposableStack.prototype.adopt( _value_, _onDisposeAsync_ )
+ This method performs the following steps when called:
1. Let _asyncDisposableStack_ be the *this* value.
1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]).
- 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, return *true*.
- 1. Otherwise, return *false*.
+ 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception.
+ 1. If IsCallable(_onDisposeAsync_) is *false*, throw a *TypeError* exception.
+ 1. Let _closure_ be a new Abstract Closure with no parameters that captures _value_ and _onDisposeAsync_ and performs the following steps when called:
+ 1. Return ? Call(_onDisposeAsync_, *undefined*, « _value_ »).
+ 1. Let _F_ be CreateBuiltinFunction(_closure_, 0, *""*, « »).
+ 1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], *undefined*, ~async-dispose~, _F_).
+ 1. Return _value_.
+
+
+
+
+ AsyncDisposableStack.prototype.defer( _onDisposeAsync_ )
+ This method performs the following steps when called:
+
+ 1. Let _asyncDisposableStack_ be the *this* value.
+ 1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]).
+ 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception.
+ 1. If IsCallable(_onDisposeAsync_) is *false*, throw a *TypeError* exception.
+ 1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], *undefined*, ~async-dispose~, _onDisposeAsync_).
+ 1. Return *undefined*.
@@ -4721,44 +4740,14 @@ contributors: Ron Buckton, Ecma International
-
- AsyncDisposableStack.prototype.use( _value_ )
- This method performs the following steps when called:
-
- 1. Let _asyncDisposableStack_ be the *this* value.
- 1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]).
- 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception.
- 1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], _value_, ~async-dispose~).
- 1. Return _value_.
-
-
-
-
- AsyncDisposableStack.prototype.adopt( _value_, _onDisposeAsync_ )
- This method performs the following steps when called:
-
- 1. Let _asyncDisposableStack_ be the *this* value.
- 1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]).
- 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception.
- 1. If IsCallable(_onDisposeAsync_) is *false*, throw a *TypeError* exception.
- 1. Let _closure_ be a new Abstract Closure with no parameters that captures _value_ and _onDisposeAsync_ and performs the following steps when called:
- 1. Return ? Call(_onDisposeAsync_, *undefined*, « _value_ »).
- 1. Let _F_ be CreateBuiltinFunction(_closure_, 0, *""*, « »).
- 1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], *undefined*, ~async-dispose~, _F_).
- 1. Return _value_.
-
-
-
-
- AsyncDisposableStack.prototype.defer( _onDisposeAsync_ )
- This method performs the following steps when called:
+
+ get AsyncDisposableStack.prototype.disposed
+ `AsyncDisposableStack.prototype.disposed` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:
1. Let _asyncDisposableStack_ be the *this* value.
1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]).
- 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception.
- 1. If IsCallable(_onDisposeAsync_) is *false*, throw a *TypeError* exception.
- 1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], *undefined*, ~async-dispose~, _onDisposeAsync_).
- 1. Return *undefined*.
+ 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, return *true*.
+ 1. Otherwise, return *false*.
@@ -4778,6 +4767,18 @@ contributors: Ron Buckton, Ecma International
+
+ AsyncDisposableStack.prototype.use( _value_ )
+ This method performs the following steps when called:
+
+ 1. Let _asyncDisposableStack_ be the *this* value.
+ 1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]).
+ 1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception.
+ 1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], _value_, ~async-dispose~).
+ 1. Return _value_.
+
+
+
AsyncDisposableStack.prototype [ @@asyncDispose ] ()
The initial value of the @@asyncDispose property is %AsyncDisposableStack.prototype.disposeAsync%, defined in .