tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

await-using-sync-dispose-throw-rejection.js (406B)


      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 }