js/src/jit-test/tests/closures/closure-plusplus.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 actual = '';
     2 expected = '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,';
     4 function slice(a, b)
     5 {
     6   //return { x: a + ':' + b };
     7   return b;
     8 }
    10 function f()
    11 {
    12   var length = 20;
    13   var index = 0;
    15   function get3() {
    16     //appendToActual("get3 " + index);
    17     if (length - index < 3)
    18       return null;
    19     return slice(index, ++index);
    20   }
    22   var bytes = null;
    23   while (bytes = get3()) {
    24     appendToActual(bytes);
    25   }
    26 }
    28 f();
    31 assertEq(actual, expected)

mercurial