tor-browser

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

bug1782558-veclen.js (523B)


      1 // |jit-test| skip-if: getBuildConfiguration("pointer-byte-size") > 4 || getBuildConfiguration("android")
      2 
      3 // On 64-bit, this will allocate 2G temporary strings for keys while
      4 // stringifying the Array, which takes a rather long time and doesn't have the
      5 // potential of the problematic overflowing anyway.
      6 
      7 try {
      8    let x = [];
      9    x.length = Math.pow(2, 32) - 1;
     10    x + 1;
     11    assertEq(true, false, "overflow expected");
     12 } catch (e) {
     13    assertEq((e + "").includes("InternalError: allocation size overflow"), true);
     14 }