js/src/jit-test/tests/pic/self8.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 // getprop, self, 8 shapes
     3 var expected = "0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,";
     4 var actual = '';
     6 function letter(i) {
     7   return String.fromCharCode(97 + i);
     8 }
    10 function f() {
    11   // Build 8 objects with different shapes and x in different slots.
    12   var oa = [];
    13   for (var i = 0; i < 8; ++i) {
    14     var o = {};
    15     for (var j = 0; j < 8; ++j) {
    16       if (j != i) {
    17 	o[letter(j)] = 1000 + i * 10 + j;
    18       } else {
    19 	o.x = i;
    20       }
    21     }
    22     oa[i] = o;
    23   }
    25   for (var i = 0; i < 24; ++i) {
    26     actual += oa[i%8].x + ',';
    27   }
    28 }
    30 f();
    32 assertEq(actual, expected);

mercurial