js/src/jit-test/tests/basic/testLoopWithUndefined2.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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");

mercurial