tor-browser

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

closure-plusplus.js (455B)


      1 actual = '';
      2 expected = '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,';
      3 
      4 function slice(a, b)
      5 {
      6  //return { x: a + ':' + b };
      7  return b;
      8 }
      9 
     10 function f()
     11 {
     12  var length = 20;
     13  var index = 0;
     14 
     15  function get3() {
     16    //appendToActual("get3 " + index);
     17    if (length - index < 3)
     18      return null;
     19    return slice(index, ++index);
     20  }
     21 
     22  var bytes = null;
     23  while (bytes = get3()) {
     24    appendToActual(bytes);
     25  }
     26 }
     27 
     28 f();
     29 
     30 
     31 assertEq(actual, expected)