tor-browser

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

bug1928407.js (513B)


      1 // Create a two-byte string which has only Latin-1 characters.
      2 var str = newString("12345678901234567890", {twoByte: true});
      3 
      4 // Create a segmenter for |str|.
      5 var segmenter = new Intl.Segmenter();
      6 var segments = segmenter.segment(str);
      7 var segment = segments.containing(0);
      8 
      9 var obj = {};
     10 
     11 // `obj[str]` to atomize the string. This will change |str| to a dependent
     12 // string of the newly created atom. The atom string is allocated as Latin-1,
     13 // because all characters are Latin-1.
     14 assertEq(obj[str], undefined);