tor-browser

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

bug-1603330.js (322B)


      1 // Allocate the object in the function to prevent marked as a singleton so the
      2 // object won't be kept alive by IC stub.
      3 function allocObj() { return {}; }
      4 
      5 let wr;
      6 {
      7  let obj = allocObj();
      8  wr = new WeakRef(obj);
      9 }
     10 
     11 assertEq(wr.deref() !== undefined, true);
     12 
     13 clearKeptObjects();
     14 gc();
     15 
     16 assertEq(wr.deref(), undefined);