tor-browser

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

bug943126.js (533B)


      1 // Test fast-path for String.split("").
      2 
      3 load(libdir + 'eqArrayHelper.js');
      4 
      5 assertEqArray("".split(""), []);
      6 assertEqArray("a".split(""), ["a"]);
      7 assertEqArray("abc".split(""), ["a", "b", "c"]);
      8 
      9 assertEqArray("abcd".split("", 2), ["a", "b"]);
     10 assertEqArray("abcd".split("", 0), []);
     11 assertEqArray("abcd".split("", -1), ["a", "b", "c", "d"]);
     12 
     13 // Note: V8 disagrees about this one, but we are correct by ecma-262 15.5.4.14 part 9.
     14 assertEqArray("abcd".split(undefined, 0), []);
     15 
     16 assertEqArray("abcd".split(undefined, 1), ["abcd"]);