js/src/jit-test/tests/ion/bug855514.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 b = 1.5;
     2 var arr;
     3 function f_int(arr, index) {
     4     for (var i=0; i<100; i++) {
     5         arr[index]++;
     6     }
     7 }
     8 arr = [1, 2, 3];
     9 f_int(arr, "1");
    10 assertEq(arr[1], 102);
    11 arr = [1, 2, 3];
    12 f_int(arr, 1);
    13 assertEq(arr[1], 102);
    15 function f_double(arr, index) {
    16     for (var i=0; i<100; i++) {
    17         arr[+Math.pow(index,1.0)*1.5/b]++;
    18     }
    19 }
    20 arr = [1, 2, 3];
    21 f_double(arr, 1.0);
    22 assertEq(arr[1], 102);
    23 arr = [1, 2, 3];
    24 f_double(arr, NaN);
    25 assertEq(arr[1], 2);

mercurial