[explicit-resource-management] Return undefined from dispose builtin

This CL fixes the bug of returning true in dispose method of
DisposableStack.

Bug: 385547086
Change-Id: Iddb72962bd5f7de1ee9346cda3094e98e0565119
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6119280
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#97920}
This commit is contained in:
Rezvan Mahdavi Hezaveh 2024-12-26 12:19:20 -08:00 committed by test262-merge-bot
parent c4317b0cb5
commit 8296db8873
2 changed files with 31 additions and 0 deletions

View File

@ -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();
});

View File

@ -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);
})();