| await-using-allows-null-initializer.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Allows null in initializer of 'await using'
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
...
...
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
1534 |
- |
| await-using-allows-undefined-initializer.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Allows undefined in initializer of 'await using'
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
...
...
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
1538 |
- |
| await-using-does-not-imply-await-if-not-evaluated.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: An 'await using' does not imply an Await occurs if the statement is not evaluated
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
b. Let resource be ? CreateDisposableResource(V, hint).
...
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
i. Set V to undefined.
ii. Set method to undefined.
...
...
3. Return the DisposableResource Record { [[ResourceValue]]: V, [[Hint]]: hint, [[DisposeMethod]]: method }.
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
4021 |
- |
| await-using-implies-await-if-evaluated.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: An 'await using' implies an Await occurs if the statement is evaluated, even if all initializers are 'null' or 'undefined'
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
b. Let resource be ? CreateDisposableResource(V, hint).
...
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
i. Set V to undefined.
ii. Set method to undefined.
...
...
3. Return the DisposableResource Record { [[ResourceValue]]: V, [[Hint]]: hint, [[DisposeMethod]]: method }.
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
4315 |
- |
| await-using-Symbol.asyncDispose-allows-non-promise-return-value.js |
---
esid: sec-disposeresources
description: >
`await using` allows a non-Promise return value from `[Symbol.asyncDispose]()`
info: |
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
1813 |
- |
| await-using-Symbol.asyncDispose-allows-promiselike-return-value.js |
---
esid: sec-disposeresources
description: >
`await using` allows non-native `Promise`-like return value from `[Symbol.asyncDispose]()`
info: |
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
1904 |
- |
| block-local-closure-get-before-initialization.js |
---
esid: sec-declarative-environment-records-getbindingvalue-n-s
description: >
await using: block local closure [[Get]] before initialization.
(TDZ, Temporal Dead Zone)
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
842 |
- |
| block-local-use-before-initialization-in-declaration-statement.js |
---
esid: sec-declarative-environment-records-getbindingvalue-n-s
description: >
await using: block local use before initialization in declaration statement.
(TDZ, Temporal Dead Zone)
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
833 |
- |
| block-local-use-before-initialization-in-prior-statement.js |
---
esid: sec-declarative-environment-records-getbindingvalue-n-s
description: >
await using: block local use before initialization in prior statement.
(TDZ, Temporal Dead Zone)
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
827 |
- |
| browser.js |
|
0 |
- |
| fn-name-arrow.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Assignment of function `name` attribute (ArrowFunction)
info: |
LexicalBinding : BindingIdentifier Initializer
...
3. If IsAnonymousFunctionDefinition(Initializer) is true, then
a. Let value be NamedEvaluation of Initializer with argument bindingId
flags: [async]
includes: [propertyHelper.js, asyncHelpers.js]
features: [explicit-resource-management]
--- |
1274 |
- |
| fn-name-class.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Assignment of function `name` attribute (ClassExpression)
info: |
LexicalBinding : BindingIdentifier Initializer
...
3. If IsAnonymousFunctionDefinition(Initializer) is true, then
a. Let value be NamedEvaluation of Initializer with argument bindingId
flags: [async]
includes: [propertyHelper.js, asyncHelpers.js]
features: [class, explicit-resource-management]
--- |
1408 |
- |
| fn-name-cover.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: >
Assignment of function `name` attribute (CoverParenthesizedExpression)
info: |
LexicalBinding : BindingIdentifier Initializer
...
3. If IsAnonymousFunctionDefinition(Initializer) is true, then
a. Let value be NamedEvaluation of Initializer with argument bindingId
flags: [async]
includes: [propertyHelper.js, asyncHelpers.js]
features: [explicit-resource-management]
--- |
1382 |
- |
| fn-name-fn.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Assignment of function `name` attribute (FunctionExpression)
info: |
LexicalBinding : BindingIdentifier Initializer
...
3. If IsAnonymousFunctionDefinition(Initializer) is true, then
a. Let value be NamedEvaluation of Initializer with argument bindingId
flags: [async]
includes: [propertyHelper.js, asyncHelpers.js]
features: [explicit-resource-management]
--- |
1347 |
- |
| fn-name-gen.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Assignment of function `name` attribute (GeneratorExpression)
info: |
LexicalBinding : BindingIdentifier Initializer
...
3. If IsAnonymousFunctionDefinition(Initializer) is true, then
a. Let value be NamedEvaluation of Initializer with argument bindingId
flags: [async]
includes: [propertyHelper.js, asyncHelpers.js]
features: [generators,explicit-resource-management]
--- |
1370 |
- |
| function-local-closure-get-before-initialization.js |
---
esid: sec-declarative-environment-records-getbindingvalue-n-s
description: >
await using: function local closure [[Get]] before initialization.
(TDZ, Temporal Dead Zone)
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
845 |
- |
| function-local-use-before-initialization-in-declaration-statement.js |
---
esid: sec-declarative-environment-records-getbindingvalue-n-s
description: >
await using: function local use before initialization in declaration statement.
(TDZ, Temporal Dead Zone)
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
833 |
- |
| function-local-use-before-initialization-in-prior-statement.js |
---
esid: sec-declarative-environment-records-getbindingvalue-n-s
description: >
await using: function local use before initialization in prior statement.
(TDZ, Temporal Dead Zone)
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
830 |
- |
| gets-initializer-does-not-read-Symbol.dispose-if-Symbol.asyncDispose-exists.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Does not read `[Symbol.dispose]` if `[Symbol.asyncDispose]` is neither null or undefined.
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
BindingList : BindingList , LexicalBinding
1. Perform ? BindingEvaluation of BindingList with argument hint.
2. Perform ? BindingEvaluation of LexicalBinding with argument hint.
3. Return unused.
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused
b. Let resource be ? CreateDisposableResource(V, hint).
...
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
i. Set V to undefined
ii. Set method to undefined
b. Else,
i. If Type(V) is not Object, throw a TypeError exception.
ii. Set method to ? GetDisposeMethod(V, hint).
iii. If method is undefined, throw a TypeError exception.
2. Else,
a. ...
3. Return the DisposableResource Record { [[ResourceValue]]: V, [[Hint]]: hint, [[DisposeMethod]]: method }.
GetDisposeMethod ( V, hint )
1. If hint is async-dispose, then
a. Let method be ? GetMethod(V, @@asyncDispose).
b. If method is undefined, then
i. Set method to ? GetMethod(V, @@dispose).
2. Else,
a. Let method be ? GetMethod(V, @@dispose).
3. Return method.
flags: [async]
includes: [asyncHelpers.js, deepEqual.js]
features: [explicit-resource-management]
--- |
3070 |
- |
| gets-initializer-Symbol.asyncDispose-property-once.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Only reads `[Symbol.asyncDispose]` method once, when initialized.
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
BindingList : BindingList , LexicalBinding
1. Perform ? BindingEvaluation of BindingList with argument hint.
2. Perform ? BindingEvaluation of LexicalBinding with argument hint.
3. Return unused.
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused
b. Let resource be ? CreateDisposableResource(V, hint).
...
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
i. Set V to undefined
ii. Set method to undefined
b. Else,
i. If Type(V) is not Object, throw a TypeError exception.
ii. Set method to ? GetDisposeMethod(V, hint).
iii. If method is undefined, throw a TypeError exception.
2. Else,
a. ...
3. Return the DisposableResource Record { [[ResourceValue]]: V, [[Hint]]: hint, [[DisposeMethod]]: method }.
GetDisposeMethod ( V, hint )
1. If hint is async-dispose, then
a. Let method be ? GetMethod(V, @@asyncDispose).
b. If method is undefined, then
i. Set method to ? GetMethod(V, @@dispose).
2. Else,
a. Let method be ? GetMethod(V, @@dispose).
3. Return method.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2947 |
- |
| gets-initializer-Symbol.dispose-after-Symbol.asyncDispose-is-null.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Reads `[Symbol.dispose]` method if `[Symbol.asyncDispose]` is null
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
BindingList : BindingList , LexicalBinding
1. Perform ? BindingEvaluation of BindingList with argument hint.
2. Perform ? BindingEvaluation of LexicalBinding with argument hint.
3. Return unused.
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused
b. Let resource be ? CreateDisposableResource(V, hint).
...
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
i. Set V to undefined
ii. Set method to undefined
b. Else,
i. If Type(V) is not Object, throw a TypeError exception.
ii. Set method to ? GetDisposeMethod(V, hint).
iii. If method is undefined, throw a TypeError exception.
2. Else,
a. ...
3. Return the DisposableResource Record { [[ResourceValue]]: V, [[Hint]]: hint, [[DisposeMethod]]: method }.
GetDisposeMethod ( V, hint )
1. If hint is async-dispose, then
a. Let method be ? GetMethod(V, @@asyncDispose).
b. If method is undefined, then
i. Set method to ? GetMethod(V, @@dispose).
2. Else,
a. Let method be ? GetMethod(V, @@dispose).
3. Return method.
flags: [async]
includes: [asyncHelpers.js, deepEqual.js]
features: [explicit-resource-management]
--- |
3087 |
- |
| gets-initializer-Symbol.dispose-after-Symbol.asyncDispose-is-undefined.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Reads `[Symbol.dispose]` method if `[Symbol.asyncDispose]` is undefined.
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
BindingList : BindingList , LexicalBinding
1. Perform ? BindingEvaluation of BindingList with argument hint.
2. Perform ? BindingEvaluation of LexicalBinding with argument hint.
3. Return unused.
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused
b. Let resource be ? CreateDisposableResource(V, hint).
...
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
i. Set V to undefined
ii. Set method to undefined
b. Else,
i. If Type(V) is not Object, throw a TypeError exception.
ii. Set method to ? GetDisposeMethod(V, hint).
iii. If method is undefined, throw a TypeError exception.
2. Else,
a. ...
3. Return the DisposableResource Record { [[ResourceValue]]: V, [[Hint]]: hint, [[DisposeMethod]]: method }.
GetDisposeMethod ( V, hint )
1. If hint is async-dispose, then
a. Let method be ? GetMethod(V, @@asyncDispose).
b. If method is undefined, then
i. Set method to ? GetMethod(V, @@dispose).
2. Else,
a. Let method be ? GetMethod(V, @@dispose).
3. Return method.
flags: [async]
includes: [asyncHelpers.js, deepEqual.js]
features: [explicit-resource-management]
--- |
3103 |
- |
| gets-initializer-Symbol.dispose-property-once.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Only reads `[Symbol.dispose]` method once, when initialized.
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
BindingList : BindingList , LexicalBinding
1. Perform ? BindingEvaluation of BindingList with argument hint.
2. Perform ? BindingEvaluation of LexicalBinding with argument hint.
3. Return unused.
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused
b. Let resource be ? CreateDisposableResource(V, hint).
...
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
i. Set V to undefined
ii. Set method to undefined
b. Else,
i. If Type(V) is not Object, throw a TypeError exception.
ii. Set method to ? GetDisposeMethod(V, hint).
iii. If method is undefined, throw a TypeError exception.
2. Else,
a. ...
3. Return the DisposableResource Record { [[ResourceValue]]: V, [[Hint]]: hint, [[DisposeMethod]]: method }.
GetDisposeMethod ( V, hint )
1. If hint is async-dispose, then
a. Let method be ? GetMethod(V, @@asyncDispose).
b. If method is undefined, then
i. Set method to ? GetMethod(V, @@dispose).
2. Else,
a. Let method be ? GetMethod(V, @@dispose).
3. Return method.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2911 |
- |
| global-closure-get-before-initialization.js |
---
esid: sec-declarative-environment-records-getbindingvalue-n-s
description: >
await using: global closure [[Get]] before initialization.
(TDZ, Temporal Dead Zone)
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
836 |
- |
| global-use-before-initialization-in-declaration-statement.js |
---
esid: sec-declarative-environment-records-getbindingvalue-n-s
description: >
await using: global use before initialization in declaration statement.
(TDZ, Temporal Dead Zone)
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
827 |
- |
| global-use-before-initialization-in-prior-statement.js |
---
esid: sec-declarative-environment-records-getbindingvalue-n-s
description: >
await using: global use before initialization in prior statement.
(TDZ, Temporal Dead Zone)
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
823 |
- |
| initializer-Symbol.asyncDispose-called-at-end-of-asyncfunctionbody.js |
---
esid: sec-asyncblockstart
description: Initialized value is disposed at end of AsyncFunctionBody
info: |
AsyncBlockStart ( promiseCapability, asyncBody, asyncContext )
1. Assert: promiseCapability is a PromiseCapability Record.
2. Let runningContext be the running execution context.
3. Let closure be a new Abstract Closure with no parameters that captures promiseCapability and asyncBody and performs the following steps when called:
a. Let acAsyncContext be the running execution context.
b. Let result be Completion(Evaluation of asyncBody).
c. Assert: If we return here, the async function either threw an exception or performed an implicit or explicit return; all awaiting is done.
d. Remove acAsyncContext from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context.
e. Let env be acAsyncContext's LexicalEnvironment.
f. Set result to DisposeResources(env.[[DisposeCapability]], result).
g. If result.[[Type]] is normal, then
i. Perform ! Call(promiseCapability.[[Resolve]], undefined, « undefined »).
h. Else if result.[[Type]] is return, then
i. Perform ! Call(promiseCapability.[[Resolve]], undefined, « result.[[Value]] »).
i. Else,
i. Assert: result.[[Type]] is throw.
ii. Perform ! Call(promiseCapability.[[Reject]], undefined, « result.[[Value]] »).
j. Return unused.
4. Set the code evaluation state of asyncContext such that when evaluation is resumed for that execution context, closure will be called with no arguments.
5. Push asyncContext onto the execution context stack; asyncContext is now the running execution context.
6. Resume the suspended evaluation of asyncContext. Let result be the value returned by the resumed computation.
7. Assert: When we return here, asyncContext has already been removed from the execution context stack and runningContext is the currently running execution context.
8. Assert: result is a normal completion with a value of unused. The possible sources of this value are Await or, if the async function doesn't await anything, step 3.h above.
9. Return unused.
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
5057 |
- |
| initializer-Symbol.asyncDispose-called-at-end-of-asyncgeneratorbody.js |
---
esid: sec-asyncgeneratorstart
description: Initialized value is disposed at end of AsyncGeneratorBody
info: |
AsyncGeneratorStart ( generator, generatorBody )
1. Assert: generator.[[AsyncGeneratorState]] is undefined.
2. Let genContext be the running execution context.
3. Set the Generator component of genContext to generator.
4. Let closure be a new Abstract Closure with no parameters that captures generatorBody and performs the following steps when called:
a. Let acGenContext be the running execution context.
b. Let acGenerator be the Generator component of acGenContext.
c. If generatorBody is a Parse Node, then
i. Let result be Completion(Evaluation of generatorBody).
d. Else,
i. Assert: generatorBody is an Abstract Closure with no parameters.
ii. Let result be Completion(generatorBody()).
e. Assert: If we return here, the async generator either threw an exception or performed either an implicit or explicit return.
f. Remove acGenContext from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context.
g. Set acGenerator.[[AsyncGeneratorState]] to completed.
h. Let env be genContext's LexicalEnvironment.
i. If env is not undefined, then
i. Assert: env is a Declarative Environment Record
ii. Set result to DisposeResources(env.[[DisposeCapability]], result).
h. If result.[[Type]] is normal, set result to NormalCompletion(undefined).
i. If result.[[Type]] is return, set result to NormalCompletion(result.[[Value]]).
j. Perform AsyncGeneratorCompleteStep(acGenerator, result, true).
k. Perform AsyncGeneratorDrainQueue(acGenerator).
l. Return undefined.
5. Set the code evaluation state of genContext such that when evaluation is resumed for that execution context, closure will be called with no arguments.
6. Set generator.[[AsyncGeneratorContext]] to genContext.
7. Set generator.[[AsyncGeneratorState]] to suspendedStart.
8. Set generator.[[AsyncGeneratorQueue]] to a new empty List.
9. Return unused.
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
4989 |
- |
| initializer-Symbol.asyncDispose-called-at-end-of-block.js |
---
esid: sec-block-runtime-semantics-evaluation
description: Initialized value is disposed at end of Block
info: |
RS: Evaluation
Block : { StatementList }
...
5. Let blockValue be the result of evaluating StatementList.
6. Set blockValue to DisposeResources(blockEnv.[[DisposeCapability]], blockValue).
...
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2165 |
- |
| initializer-Symbol.asyncDispose-called-at-end-of-each-iteration-of-forofstatement.js |
---
esid: sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset
description: Initialized value is disposed at end of each iteration of ForOfStatement
info: |
ForIn/OfBodyEvaluation ( lhs, stmt, iteratorRecord, iterationKind, lhsKind, labelSet [ , iteratorKind ] )
1. If iteratorKind is not present, set iteratorKind to sync.
2. Let oldEnv be the running execution context's LexicalEnvironment.
3. Let V be undefined.
4. If IsAwaitUsingDeclaration of lhs is true, then
a. Let hint be async-dispose.
5. Else, if IsUsingDeclaration of lhs is true, then
a. Let hint be sync-dispose.
6. Else,
a. Let hint be normal.
7. Let destructuring be IsDestructuring of lhs.
8. If destructuring is true and if lhsKind is assignment, then
a. Assert: lhs is a LeftHandSideExpression.
b. Let assignmentPattern be the AssignmentPattern that is covered by lhs.
9. Repeat,
...
j. Let result be Completion(Evaluation of stmt).
k. If iterationEnv is not undefined, then
i. Set result to Completion(DisposeResources(iterationEnv.[[DisposeCapability]], result)).
...
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
3606 |
- |
| initializer-Symbol.asyncDispose-called-at-end-of-forstatement.js |
---
esid: sec-runtime-semantics-forloopevaluation
description: Initialized value is disposed at end of ForStatement
info: |
RS: ForLoopEvaluation
ForStatement : for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
...
12. Let bodyResult be Completion(ForBodyEvaluation(test, increment, Statement, perIterationLets, labelSet)).
13. Set bodyResult to Completion(DisposeResources(loopEnv.[[DisposeCapability]], bodyResult)).
14. Assert: If bodyResult.[[Type]] is normal, then bodyResult.[[Value]] is not empty.
...
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2626 |
- |
| initializer-Symbol.asyncDispose-called-if-subsequent-initializer-throws-in-forstatement-head.js |
---
esid: sec-runtime-semantics-forloopevaluation
description: Initialized value is disposed at end of FunctionBody
info: |
RS: ForLoopEvaluation
ForStatement : for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
...
7. Let forDcl be Completion(Evaluation of LexicalDeclaration).
8. If forDcl is an abrupt completion, then
a. Set forDcl to Completion(DisposeResources(loopEnv.[[DisposeCapability]], forDcl)).
b. Assert: forDcl is an abrupt completion.
c. Set the running execution context's LexicalEnvironment to oldEnv.
d. Return ? forDcl.
...
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2615 |
- |
| initializer-Symbol.asyncDispose-called-if-subsequent-initializer-throws.js |
---
esid: sec-block-runtime-semantics-evaluation
description: Initialized value is disposed even if subsequent initializer throws
info: |
RS: Evaluation
Block : { StatementList }
...
5. Let blockValue be the result of evaluating StatementList.
6. Set blockValue to DisposeResources(blockEnv.[[DisposeCapability]], blockValue).
...
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2307 |
- |
| initializer-Symbol.dispose-called-at-end-of-asyncfunctionbody.js |
---
esid: sec-asyncblockstart
description: Initialized value is disposed at end of AsyncFunctionBody
info: |
AsyncBlockStart ( promiseCapability, asyncBody, asyncContext )
1. Assert: promiseCapability is a PromiseCapability Record.
2. Let runningContext be the running execution context.
3. Let closure be a new Abstract Closure with no parameters that captures promiseCapability and asyncBody and performs the following steps when called:
a. Let acAsyncContext be the running execution context.
b. Let result be Completion(Evaluation of asyncBody).
c. Assert: If we return here, the async function either threw an exception or performed an implicit or explicit return; all awaiting is done.
d. Remove acAsyncContext from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context.
e. Let env be acAsyncContext's LexicalEnvironment.
f. Set result to DisposeResources(env.[[DisposeCapability]], result).
g. If result.[[Type]] is normal, then
i. Perform ! Call(promiseCapability.[[Resolve]], undefined, « undefined »).
h. Else if result.[[Type]] is return, then
i. Perform ! Call(promiseCapability.[[Resolve]], undefined, « result.[[Value]] »).
i. Else,
i. Assert: result.[[Type]] is throw.
ii. Perform ! Call(promiseCapability.[[Reject]], undefined, « result.[[Value]] »).
j. Return unused.
4. Set the code evaluation state of asyncContext such that when evaluation is resumed for that execution context, closure will be called with no arguments.
5. Push asyncContext onto the execution context stack; asyncContext is now the running execution context.
6. Resume the suspended evaluation of asyncContext. Let result be the value returned by the resumed computation.
7. Assert: When we return here, asyncContext has already been removed from the execution context stack and runningContext is the currently running execution context.
8. Assert: result is a normal completion with a value of unused. The possible sources of this value are Await or, if the async function doesn't await anything, step 3.h above.
9. Return unused.
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
5046 |
- |
| initializer-Symbol.dispose-called-at-end-of-asyncgeneratorbody.js |
---
esid: sec-asyncgeneratorstart
description: Initialized value is disposed at end of AsyncGeneratorBody
info: |
AsyncGeneratorStart ( generator, generatorBody )
1. Assert: generator.[[AsyncGeneratorState]] is undefined.
2. Let genContext be the running execution context.
3. Set the Generator component of genContext to generator.
4. Let closure be a new Abstract Closure with no parameters that captures generatorBody and performs the following steps when called:
a. Let acGenContext be the running execution context.
b. Let acGenerator be the Generator component of acGenContext.
c. If generatorBody is a Parse Node, then
i. Let result be Completion(Evaluation of generatorBody).
d. Else,
i. Assert: generatorBody is an Abstract Closure with no parameters.
ii. Let result be Completion(generatorBody()).
e. Assert: If we return here, the async generator either threw an exception or performed either an implicit or explicit return.
f. Remove acGenContext from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context.
g. Set acGenerator.[[AsyncGeneratorState]] to completed.
h. Let env be genContext's LexicalEnvironment.
i. If env is not undefined, then
i. Assert: env is a Declarative Environment Record
ii. Set result to DisposeResources(env.[[DisposeCapability]], result).
h. If result.[[Type]] is normal, set result to NormalCompletion(undefined).
i. If result.[[Type]] is return, set result to NormalCompletion(result.[[Value]]).
j. Perform AsyncGeneratorCompleteStep(acGenerator, result, true).
k. Perform AsyncGeneratorDrainQueue(acGenerator).
l. Return undefined.
5. Set the code evaluation state of genContext such that when evaluation is resumed for that execution context, closure will be called with no arguments.
6. Set generator.[[AsyncGeneratorContext]] to genContext.
7. Set generator.[[AsyncGeneratorState]] to suspendedStart.
8. Set generator.[[AsyncGeneratorQueue]] to a new empty List.
9. Return unused.
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
4978 |
- |
| initializer-Symbol.dispose-called-at-end-of-block.js |
---
esid: sec-block-runtime-semantics-evaluation
description: Initialized value is disposed at end of Block
info: |
RS: Evaluation
Block : { StatementList }
...
5. Let blockValue be the result of evaluating StatementList.
6. Set blockValue to DisposeResources(blockEnv.[[DisposeCapability]], blockValue).
...
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2154 |
- |
| initializer-Symbol.dispose-called-at-end-of-each-iteration-of-forofstatement.js |
---
esid: sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset
description: Initialized value is disposed at end of each iteration of ForOfStatement
info: |
ForIn/OfBodyEvaluation ( lhs, stmt, iteratorRecord, iterationKind, lhsKind, labelSet [ , iteratorKind ] )
1. If iteratorKind is not present, set iteratorKind to sync.
2. Let oldEnv be the running execution context's LexicalEnvironment.
3. Let V be undefined.
4. If IsAwaitUsingDeclaration of lhs is true, then
a. Let hint be async-dispose.
5. Else, if IsUsingDeclaration of lhs is true, then
a. Let hint be sync-dispose.
6. Else,
a. Let hint be normal.
7. Let destructuring be IsDestructuring of lhs.
8. If destructuring is true and if lhsKind is assignment, then
a. Assert: lhs is a LeftHandSideExpression.
b. Let assignmentPattern be the AssignmentPattern that is covered by lhs.
9. Repeat,
...
j. Let result be Completion(Evaluation of stmt).
k. If iterationEnv is not undefined, then
i. Set result to Completion(DisposeResources(iterationEnv.[[DisposeCapability]], result)).
...
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
3595 |
- |
| initializer-Symbol.dispose-called-at-end-of-forstatement.js |
---
esid: sec-runtime-semantics-forloopevaluation
description: Initialized value is disposed at end of ForStatement
info: |
RS: ForLoopEvaluation
ForStatement : for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
...
12. Let bodyResult be Completion(ForBodyEvaluation(test, increment, Statement, perIterationLets, labelSet)).
13. Set bodyResult to Completion(DisposeResources(loopEnv.[[DisposeCapability]], bodyResult)).
14. Assert: If bodyResult.[[Type]] is normal, then bodyResult.[[Value]] is not empty.
...
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2626 |
- |
| initializer-Symbol.dispose-called-if-subsequent-initializer-throws-in-forstatement-head.js |
---
esid: sec-runtime-semantics-forloopevaluation
description: Initialized value is disposed at end of FunctionBody
info: |
RS: ForLoopEvaluation
ForStatement : for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
...
7. Let forDcl be Completion(Evaluation of LexicalDeclaration).
8. If forDcl is an abrupt completion, then
a. Set forDcl to Completion(DisposeResources(loopEnv.[[DisposeCapability]], forDcl)).
b. Assert: forDcl is an abrupt completion.
c. Set the running execution context's LexicalEnvironment to oldEnv.
d. Return ? forDcl.
...
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2604 |
- |
| initializer-Symbol.dispose-called-if-subsequent-initializer-throws.js |
---
esid: sec-block-runtime-semantics-evaluation
description: Initialized value is disposed even if subsequent initializer throws
info: |
RS: Evaluation
Block : { StatementList }
...
5. Let blockValue be the result of evaluating StatementList.
6. Set blockValue to DisposeResources(blockEnv.[[DisposeCapability]], blockValue).
...
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2296 |
- |
| multiple-resources-disposed-in-reverse-order.js |
---
esid: sec-disposeresources
description: Multiple resources are disposed in the reverse of the order in which they were added
info: |
RS: Evaluation
Block : { StatementList }
...
5. Let blockValue be the result of evaluating StatementList.
6. Set blockValue to DisposeResources(blockEnv.[[DisposeCapability]], blockValue).
...
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2398 |
- |
| puts-initializer-on-top-of-disposableresourcestack-multiple-bindings.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: >
Puts initialized value on the top of the environment's [[DisposableResourceStack]] with multiple lexical bindings
in a single 'await using' declaration
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
BindingList : BindingList , LexicalBinding
1. Perform ? BindingEvaluation of BindingList with argument hint.
2. Perform ? BindingEvaluation of LexicalBinding with argument hint.
3. Return unused.
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
b. Let resource be ? CreateDisposableResource(V, hint).
3. Else,
...
3. Append resource to disposeCapability.[[DisposableResourceStack]].
4. Return unused.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2504 |
- |
| puts-initializer-on-top-of-disposableresourcestack-subsequent-usings.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: >
Puts initialized value on the top of the environment's [[DisposableResourceStack]] with multiple subsequent 'await using'
declarations in the same block scope
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
b. Let resource be ? CreateDisposableResource(V, hint).
3. Else,
...
3. Append resource to disposeCapability.[[DisposableResourceStack]].
4. Return unused.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2313 |
- |
| redeclaration-error-from-within-strict-mode-function-await-using.js |
---
esid: sec-declarative-environment-records-initializebinding-n-v
description: >
Redeclaration error within strict mode function inside non-strict code.
negative:
phase: parse
type: SyntaxError
flags: [noStrict, explicit-resource-management]
--- |
509 |
- |
| shell.js |
---
description: |
A collection of assertion and wrapper functions for testing asynchronous built-ins.
defines: [asyncTest, assert.throwsAsync]
--- |
16844 |
- |
| Symbol.asyncDispose-getter.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Invokes [Symbol.asyncDispose] getter
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
b. Let resource be ? CreateDisposableResource(V, hint).
2. Else,
...
3. Append resource to disposeCapability.[[DisposableResourceStack]].
4. Return unused.
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
...
b. Else,
i. If V is not an Object, throw a TypeError exception.
ii. Set method to ? GetDisposeMethod(V, hint).
iii. If method is undefined, throw a TypeError exception.
...
GetDisposeMethod ( V, hint )
1. If hint is async-dispose, then
a. Let method be ? GetMethod(V, @@asyncDispose).
b. If method is undefined, then
i. Set method to ? GetMethod(V, @@dispose).
2. Else,
a. Let method be ? GetMethod(V, @@dispose).
3. Return method.
GetMethod ( V, P )
1. Let func be ? GetV(V, P).
2. If func is either undefined or null, return undefined.
3. ...
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2697 |
- |
| Symbol.asyncDispose-method-called-with-correct-this.js |
---
esid: sec-block-runtime-semantics-evaluation
description: Initialized value is disposed with the correct 'this' value
info: |
RS: Evaluation
Block : { StatementList }
...
5. Let blockValue be the result of evaluating StatementList.
6. Set blockValue to DisposeResources(blockEnv.[[DisposeCapability]], blockValue).
...
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
...
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2017 |
- |
| Symbol.asyncDispose-method-not-async.js |
---
esid: sec-block-runtime-semantics-evaluation
description: Disposal succeeds even if [Symbol.disposeAsync] does not return a Promise.
info: |
RS: Evaluation
Block : { StatementList }
...
5. Let blockValue be the result of evaluating StatementList.
6. Set blockValue to DisposeResources(blockEnv.[[DisposeCapability]], blockValue).
...
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. ...
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2157 |
- |
| Symbol.dispose-getter.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Invokes [Symbol.dispose] getter
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
b. Let resource be ? CreateDisposableResource(V, hint).
2. Else,
...
3. Append resource to disposeCapability.[[DisposableResourceStack]].
4. Return unused.
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
...
b. Else,
i. If V is not an Object, throw a TypeError exception.
ii. Set method to ? GetDisposeMethod(V, hint).
iii. If method is undefined, throw a TypeError exception.
...
GetDisposeMethod ( V, hint )
1. If hint is async-dispose, then
a. Let method be ? GetMethod(V, @@asyncDispose).
b. If method is undefined, then
i. Set method to ? GetMethod(V, @@dispose).
2. Else,
a. Let method be ? GetMethod(V, @@dispose).
3. Return method.
GetMethod ( V, P )
1. Let func be ? GetV(V, P).
2. If func is either undefined or null, return undefined.
3. ...
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2680 |
- |
| Symbol.dispose-method-called-with-correct-this.js |
---
esid: sec-block-runtime-semantics-evaluation
description: Initialized value is disposed with the correct 'this' value
info: |
RS: Evaluation
Block : { StatementList }
...
5. Let blockValue be the result of evaluating StatementList.
6. Set blockValue to DisposeResources(blockEnv.[[DisposeCapability]], blockValue).
...
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
...
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
1997 |
- |
| syntax |
|
|
- |
| throws-error-as-is-if-only-one-error-during-disposal.js |
---
esid: sec-disposeresources
description: >
Rethrows an error as-is if it is the only error thrown during evaluation of subsequent statements following 'await using'
or from disposal.
info: |
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2391 |
- |
| throws-if-initializer-missing-both-Symbol.asyncDispose-and-Symbol.dispose.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Throws if initialized value is missing both the Symbol.asyncDispose and Symbol.dispose properties
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
BindingList : BindingList , LexicalBinding
1. Perform ? BindingEvaluation of BindingList with argument hint.
2. Perform ? BindingEvaluation of LexicalBinding with argument hint.
3. Return unused.
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
b. Let resource be ? CreateDisposableResource(V, hint).
3. Else,
...
3. Append resource to disposeCapability.[[DisposableResourceStack]].
4. Return unused.
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
...
b. Else,
i. If V is not an Object, throw a TypeError exception.
ii. Set method to ? GetDisposeMethod(V, hint).
iii. If method is undefined, throw a TypeError exception.
...
GetDisposeMethod ( V, hint )
1. If hint is async-dispose, then
a. Let method be ? GetMethod(V, @@asyncDispose).
b. If method is undefined, then
i. Set method to ? GetMethod(V, @@dispose).
2. Else,
a. Let method be ? GetMethod(V, @@dispose).
3. Return method.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2655 |
- |
| throws-if-initializer-not-object.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Throws if initialized value is not an Object
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
b. Let resource be ? CreateDisposableResource(V, hint).
...
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
...
b. Else,
i. If V is not an Object, throw a TypeError exception.
...
...
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2314 |
- |
| throws-if-initializer-Symbol.asyncDispose-property-is-null.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Throws if initialized value's Symbol.asyncDispose property is null and Symbol.dispose is not present
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
b. Let resource be ? CreateDisposableResource(V, hint).
2. Else,
...
3. Append resource to disposeCapability.[[DisposableResourceStack]].
4. Return unused.
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
...
b. Else,
i. If V is not an Object, throw a TypeError exception.
ii. Set method to ? GetDisposeMethod(V, hint).
iii. If method is undefined, throw a TypeError exception.
...
GetDisposeMethod ( V, hint )
1. If hint is async-dispose, then
a. Let method be ? GetMethod(V, @@asyncDispose).
b. If method is undefined, then
i. Set method to ? GetMethod(V, @@dispose).
2. Else,
a. Let method be ? GetMethod(V, @@dispose).
3. Return method.
GetMethod ( V, P )
1. Let func be ? GetV(V, P).
2. If func is either undefined or null, return undefined.
3. ...
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2595 |
- |
| throws-if-initializer-Symbol.asyncDispose-property-is-undefined.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Throws if initialized value's Symbol.asyncDispose property is undefined and Symbol.dispose is not present
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
b. Let resource be ? CreateDisposableResource(V, hint).
2. Else,
...
3. Append resource to disposeCapability.[[DisposableResourceStack]].
4. Return unused.
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
...
b. Else,
i. If V is not an Object, throw a TypeError exception.
ii. Set method to ? GetDisposeMethod(V, hint).
iii. If method is undefined, throw a TypeError exception.
...
GetDisposeMethod ( V, hint )
1. If hint is async-dispose, then
a. Let method be ? GetMethod(V, @@asyncDispose).
b. If method is undefined, then
i. Set method to ? GetMethod(V, @@dispose).
2. Else,
a. Let method be ? GetMethod(V, @@dispose).
3. Return method.
GetMethod ( V, P )
1. Let func be ? GetV(V, P).
2. If func is either undefined or null, return undefined.
3. ...
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2605 |
- |
| throws-if-initializer-Symbol.asyncDispose-property-not-callable.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Throws if initialized value's Symbol.asyncDispose property is not callable
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
b. Let resource be ? CreateDisposableResource(V, hint).
2. Else,
...
3. Append resource to disposeCapability.[[DisposableResourceStack]].
4. Return unused.
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
i. Set V to undefined.
ii. Set method to undefined.
b. Else,
i. If V is not an Object, throw a TypeError exception.
ii. Set method to ? GetDisposeMethod(V, hint).
iii. If method is undefined, throw a TypeError exception.
2. Else,
...
3. Return the DisposableResource Record { [[ResourceValue]]: V, [[Hint]]: hint, [[DisposeMethod]]: method }.
GetDisposeMethod ( V, hint )
1. If hint is async-dispose, then
a. Let method be ? GetMethod(V, @@asyncDispose).
b. If method is undefined, then
i. Set method to ? GetMethod(V, @@dispose).
2. Else,
a. Let method be ? GetMethod(V, @@dispose).
3. Return method.
GetMethod ( V, P )
1. Let func be ? GetV(V, P).
2. If func is either undefined or null, return undefined.
3. If IsCallable(func) is false, throw a TypeError exception.
4. Return func.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
3351 |
- |
| throws-if-initializer-Symbol.dispose-property-is-null.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Throws if initialized value's Symbol.dispose property is null
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
b. Let resource be ? CreateDisposableResource(V, hint).
2. Else,
...
3. Append resource to disposeCapability.[[DisposableResourceStack]].
4. Return unused.
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
...
b. Else,
i. If V is not an Object, throw a TypeError exception.
ii. Set method to ? GetDisposeMethod(V, hint).
iii. If method is undefined, throw a TypeError exception.
...
GetDisposeMethod ( V, hint )
1. If hint is async-dispose, then
a. Let method be ? GetMethod(V, @@asyncDispose).
b. If method is undefined, then
i. Set method to ? GetMethod(V, @@dispose).
2. Else,
a. Let method be ? GetMethod(V, @@dispose).
3. Return method.
GetMethod ( V, P )
1. Let func be ? GetV(V, P).
2. If func is either undefined or null, return undefined.
3. ...
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2551 |
- |
| throws-if-initializer-Symbol.dispose-property-is-undefined.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Throws if initialized value's Symbol.dispose property is undefined
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
b. Let resource be ? CreateDisposableResource(V, hint).
2. Else,
...
3. Append resource to disposeCapability.[[DisposableResourceStack]].
4. Return unused.
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
...
b. Else,
i. If V is not an Object, throw a TypeError exception.
ii. Set method to ? GetDisposeMethod(V, hint).
iii. If method is undefined, throw a TypeError exception.
...
GetDisposeMethod ( V, hint )
1. If hint is async-dispose, then
a. Let method be ? GetMethod(V, @@asyncDispose).
b. If method is undefined, then
i. Set method to ? GetMethod(V, @@dispose).
2. Else,
a. Let method be ? GetMethod(V, @@dispose).
3. Return method.
GetMethod ( V, P )
1. Let func be ? GetV(V, P).
2. If func is either undefined or null, return undefined.
3. ...
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2561 |
- |
| throws-if-initializer-Symbol.dispose-property-not-callable.js |
---
esid: sec-let-and-const-declarations-runtime-semantics-evaluation
description: Throws if initialized value's Symbol.dispose property is not callable
info: |
RS: Evaluation
AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList ;
1. Perform ? BindingEvaluation of BindingList with argument async-dispose.
2. Return empty.
RS: BindingEvaluation
LexicalBinding : BindingIdentifier Initializer
...
5. Return ? InitializeReferencedBinding(lhs, value, hint).
InitializeReferencedBinding ( V, W )
...
4. Return ? base.InitializeBinding(V.[[ReferencedName]], W).
InitializeBinding ( N, V, hint )
...
2. If hint is not normal, perform ? AddDisposableResource(envRec.[[DisposeCapability]], V, hint).
...
AddDisposableResource ( disposeCapability, V, hint [, method ] )
1. If method is not present then,
a. If V is either null or undefined and hint is sync-dispose, then
i. Return unused.
b. Let resource be ? CreateDisposableResource(V, hint).
2. Else,
...
3. Append resource to disposeCapability.[[DisposableResourceStack]].
4. Return unused.
CreateDisposableResource ( V, hint [ , method ] )
1. If method is not present, then
a. If V is either null or undefined, then
i. Set V to undefined.
ii. Set method to undefined.
b. Else,
i. If V is not an Object, throw a TypeError exception.
ii. Set method to ? GetDisposeMethod(V, hint).
iii. If method is undefined, throw a TypeError exception.
2. Else,
...
3. Return the DisposableResource Record { [[ResourceValue]]: V, [[Hint]]: hint, [[DisposeMethod]]: method }.
GetDisposeMethod ( V, hint )
1. If hint is async-dispose, then
a. Let method be ? GetMethod(V, @@asyncDispose).
b. If method is undefined, then
i. Set method to ? GetMethod(V, @@dispose).
2. Else,
a. Let method be ? GetMethod(V, @@dispose).
3. Return method.
GetMethod ( V, P )
1. Let func be ? GetV(V, P).
2. If func is either undefined or null, return undefined.
3. If IsCallable(func) is false, throw a TypeError exception.
4. Return func.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
3326 |
- |
| throws-suppressederror-if-multiple-errors-during-disposal.js |
---
esid: sec-disposeresources
description: >
Throws a nested hierarchy of SuppressedErrors if multiple errors were thrown during evaluation of subsequent statements following 'await using'
and/or from disposal.
info: |
DisposeResources ( disposeCapability, completion )
1. For each resource of disposeCapability.[[DisposableResourceStack]], in reverse list order, do
a. Let result be Dispose(resource.[[ResourceValue]], resource.[[Hint]], resource.[[DisposeMethod]]).
b. If result.[[Type]] is throw, then
i. If completion.[[Type]] is throw, then
1. Set result to result.[[Value]].
2. Let suppressed be completion.[[Value]].
3. Let error be a newly created SuppressedError object.
4. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "error", result).
5. Perform ! CreateNonEnumerableDataPropertyOrThrow(error, "suppressed", suppressed).
6. Set completion to ThrowCompletion(error).
ii. Else,
1. Set completion to result.
2. Return completion.
Dispose ( V, hint, method )
1. If method is undefined, let result be undefined.
2. Else, let result be ? Call(method, V).
3. If hint is async-dispose, then
a. Perform ? Await(result).
4. Return undefined.
flags: [async]
includes: [asyncHelpers.js]
features: [explicit-resource-management]
--- |
2678 |
- |