Debian Codegraph @

js/src/jit-test/tests/explicit-resource-management/await-using-sync-dispose-throw-rejection.js

raw
1 // |jit-test| skip-if: !getBuildConfiguration("explicit-resource-management"); --enable-explicit-resource-management
2
3 {
4 let called = false;
5 async function testSyncThrowIsRejection() {
6 await using x = {
7 [Symbol.dispose]() {
8 throw 1;
9 }
10 }
11 }
12 testSyncThrowIsRejection().catch(e => {
13 called = true;
14 assertEq(e, 1);
15 });
16 drainJobQueue();
17 assertEq(called, true);
18 }