From b3f67f4aafc9372ab7bfaea4290413b3e241f6a5 Mon Sep 17 00:00:00 2001 From: Rezvan Mahdavi Hezaveh Date: Wed, 19 Feb 2025 12:21:26 -0800 Subject: [PATCH] [explicit-resource-management] Fix await using in top level module This CL adds one suspend point in any scope that has at least one `await using` in it. Bug: 396661138 Change-Id: I144a0ca49395b34309e7e35f070c98cc145af34b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6279751 Commit-Queue: Rezvan Mahdavi Hezaveh Reviewed-by: Shu-yu Guo Cr-Commit-Position: refs/heads/main@{#98811} --- .../await-using-in-top-level-module.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/staging/explicit-resource-management/await-using-in-top-level-module.js diff --git a/test/staging/explicit-resource-management/await-using-in-top-level-module.js b/test/staging/explicit-resource-management/await-using-in-top-level-module.js new file mode 100644 index 0000000000..18c2bfc50e --- /dev/null +++ b/test/staging/explicit-resource-management/await-using-in-top-level-module.js @@ -0,0 +1,14 @@ +// Copyright (C) 2025 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: await using should be allowed in top-level module. +flags: [module] +features: [explicit-resource-management] +---*/ + +await using x = { + [Symbol.asyncDispose]() { + return 42; + }, +};