Skip to content

Commit

Permalink
[explicit-resource-management] Return undefined from dispose builtin
Browse files Browse the repository at this point in the history
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 <[email protected]>
Commit-Queue: Rezvan Mahdavi Hezaveh <[email protected]>
Cr-Commit-Position: refs/heads/main@{#97920}
  • Loading branch information
rmahdav authored and [email protected] committed Dec 26, 2024
1 parent c4317b0 commit fd58598
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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();
});
Original file line number Diff line number Diff line change
@@ -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);
})();

0 comments on commit fd58598

Please sign in to comment.