2024-09-17 12:09:47 +02:00
|
|
|
// Copyright 2024 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
//
|
2025-04-29 08:03:15 +02:00
|
|
|
// Flags: --js-staging
|
2024-09-17 12:09:47 +02:00
|
|
|
|
|
|
|
let values = [];
|
|
|
|
|
|
|
|
(async () => {
|
|
|
|
for (let i = 0; i < 10; ++i) {
|
|
|
|
values.push(i);
|
|
|
|
await 0;
|
|
|
|
}
|
|
|
|
})();
|
|
|
|
|
|
|
|
async function TestCountTicks() {
|
2025-01-30 16:35:04 +01:00
|
|
|
using x = {
|
2024-09-17 12:09:47 +02:00
|
|
|
value: 1,
|
2025-01-30 16:35:04 +01:00
|
|
|
[Symbol.dispose]() {
|
2024-09-17 12:09:47 +02:00
|
|
|
values.push(42);
|
|
|
|
}
|
|
|
|
};
|
2025-01-30 16:35:04 +01:00
|
|
|
await using y = null;
|
|
|
|
await using z = undefined;
|
2024-09-17 12:09:47 +02:00
|
|
|
values.push(44);
|
|
|
|
}
|
|
|
|
|
|
|
|
async function RunTest() {
|
|
|
|
await TestCountTicks();
|
2025-01-30 16:35:04 +01:00
|
|
|
assertSame('0,44,1,42,2', values.join(','));
|
2024-09-17 12:09:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
RunTest();
|