tor-browser

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

testLoopWithUndefined2.js (594B)


      1 function loopWithUndefined2(t, dostuff, val) {
      2    var a = new Array(6);
      3    for (var i = 0; i < 6; i++) {
      4        if (dostuff) {
      5            val = 1;
      6            a[i] = (t > val);
      7        } else {
      8            a[i] = (val == undefined);
      9        }
     10    }
     11    return a;
     12 }
     13 function testLoopWithUndefined2() {
     14    var a = loopWithUndefined2(5.0, true, 2);
     15    var b = loopWithUndefined2(5.0, true);
     16    var c = loopWithUndefined2(5.0, false, 8);
     17    var d = loopWithUndefined2(5.0, false);
     18    return [a[0], b[0], c[0], d[0]].join(",");
     19 }
     20 assertEq(testLoopWithUndefined2(), "true,true,false,true");