diff --git a/test/staging/explicit-resource-management/async-disposable-stack-dispose-async-resolved-by-undefined.js b/test/staging/explicit-resource-management/async-disposable-stack-dispose-async-resolved-by-undefined.js new file mode 100644 index 0000000000..e32160e1ea --- /dev/null +++ b/test/staging/explicit-resource-management/async-disposable-stack-dispose-async-resolved-by-undefined.js @@ -0,0 +1,18 @@ +// Copyright (C) 2024 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + AsyncDisposableStack resolved with undefned. +includes: [asyncHelpers.js] +flags: [async] +features: [explicit-resource-management] +---*/ + +asyncTest(async function() { + async function TestAsyncDisposableStackDefer() { + let stack = new AsyncDisposableStack(); + assert.sameValue(await stack.disposeAsync(), undefined); + }; + await TestAsyncDisposableStackDefer(); + }); diff --git a/test/staging/explicit-resource-management/disposable-stack-dispose-return-undefined.js b/test/staging/explicit-resource-management/disposable-stack-dispose-return-undefined.js new file mode 100644 index 0000000000..ccf19280c1 --- /dev/null +++ b/test/staging/explicit-resource-management/disposable-stack-dispose-return-undefined.js @@ -0,0 +1,13 @@ +// Copyright (C) 2024 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + DisposableStack return undefned. +features: [explicit-resource-management] +---*/ + +(function TestDisposableStackDisposeReturnsUndefined() { + let stack = new DisposableStack(); + assert.sameValue(stack.dispose(), undefined); +})();