Debian Codegraph @

js/src/jit-test/tests/explicit-resource-management/await-using-async-dispose-awaited.js

raw
1 // |jit-test| skip-if: !getBuildConfiguration("explicit-resource-management"); --enable-explicit-resource-management
2
3 let catchCalled = false;
4 async function testAsyncDisposeAwaitUsingAwaited() {
5 await using x = {
6 [Symbol.asyncDispose]: () => Promise.reject('async')
7 };
8 }
9 testAsyncDisposeAwaitUsingAwaited().catch((e) => {
10 catchCalled = true;
11 assertEq(e, 'async');
12 });
13 drainJobQueue();
14 assertEq(catchCalled, true);