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
|
|
|
values.push(42);
|
|
|
|
let stack = new AsyncDisposableStack();
|
|
|
|
stack.use(null);
|
|
|
|
stack.use(undefined);
|
|
|
|
stack.use(null);
|
|
|
|
stack.use(undefined);
|
|
|
|
stack.use(null);
|
|
|
|
stack.use(undefined);
|
|
|
|
await stack.disposeAsync();
|
|
|
|
values.push(43);
|
2024-09-17 12:09:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
async function RunTest() {
|
|
|
|
await TestCountTicks();
|
2025-01-30 16:35:04 +01:00
|
|
|
assertSame('0,42,1,2,43,3', values.join(','));
|
2024-09-17 12:09:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
RunTest();
|