js/src/jit-test/tests/pic/self8.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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