tor-browser

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

await-using-sync-dispose-not-awaited.js (492B)


      1 // |jit-test| skip-if: !getBuildConfiguration("explicit-resource-management"); error:Unhandled rejection: "sync"; --enable-explicit-resource-management
      2 
      3 let fulfilled = false;
      4 async function testSyncDisposeAwaitUsingNotAwaited() {
      5  await using x = {
      6    [Symbol.dispose]: () => Promise.reject('sync')
      7  };
      8 }
      9 testSyncDisposeAwaitUsingNotAwaited().then(() => {
     10  fulfilled = true;
     11 });
     12 drainJobQueue();
     13 // Returning a rejected from the sync dispose shouldn't reject.
     14 assertEq(fulfilled, true);