js/src/jit-test/tests/basic/testBug602413.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 var so = [];
     3 function U(unusedV)
     4 {
     5   for (var i = 0; i < so.length; ++i)
     6     return false;
     7   so.push(0);
     8 }
    10 function C(v)
    11 {
    12   if (typeof v == "object" || typeof v == "function") {
    13     for (var i = 0; i < 10; ++i) {}
    14     U(v);
    15   }
    16 }
    18 function exploreProperties(obj)
    19 {
    20   var props = [];
    21   for (var o = obj; o; o = Object.getPrototypeOf(o)) {
    22     props = props.concat(Object.getOwnPropertyNames(o));
    23   }
    24   for (var i = 0; i < props.length; ++i) {
    25     var p = props[i];
    26     try { 
    27       var v = obj[p];
    28       C(v);
    29     } catch(e) { }
    30   }
    31 }
    33 function boom()
    34 {
    35   var a = [];
    36   var b = function(){};
    37   var c = [{}];
    38   exploreProperties(a);
    39   exploreProperties(b);
    40   exploreProperties(c);
    41   exploreProperties(c);
    42 }
    44 boom();

mercurial