-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 <[email protected]> Commit-Queue: Rezvan Mahdavi Hezaveh <[email protected]> Cr-Commit-Position: refs/heads/main@{#97920}
- Loading branch information
1 parent
c4317b0
commit fd58598
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...xplicit-resource-management/async-disposable-stack-dispose-async-resolved-by-undefined.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); |
13 changes: 13 additions & 0 deletions
13
test/staging/explicit-resource-management/disposable-stack-dispose-return-undefined.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
})(); |