tor-browser

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

bug1827072.js (532B)


      1 assertThrows(() => newString("", { capacity: 1 }));
      2 assertThrows(() => newString("x", { capacity: 2 }));
      3 
      4 // Too large for an inline string.
      5 const nonInlineLinear = "123456789012345678901234567890";
      6 assertEq(nonInlineLinear.length, 30);
      7 
      8 newString(nonInlineLinear, { capacity: 29, tenured: true });
      9 newString(nonInlineLinear, { capacity: 30, tenured: true });
     10 newString(nonInlineLinear, { capacity: 31, tenured: true });
     11 
     12 function assertThrows(f) {
     13  try {
     14    f();
     15  } catch {
     16    return;
     17  }
     18  throw new Error("missing error");
     19 }