js/src/jit-test/tests/jaeger/recompile/native.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.

     2 /* Handle recompilations triggered by native calls. */
     4 function dofloor(v)
     5 {
     6   var res = "";
     7   for (var i = 0; i < 10; i++) {
     8     var q = Math.floor(v + i);
     9     res += q + ",";
    10   }
    11   assertEq(res, "2147483642,2147483643,2147483644,2147483645,2147483646,2147483647,2147483648,2147483649,2147483650,2147483651,");
    12 }
    13 dofloor(0x7ffffffa + .5);
    15 function mapfloor(a)
    16 {
    17   var b = a.map(function(v) { return Math.floor(v); });
    19   var res = "";
    20   for (var i = 0; i < b.length; i++)
    21     res += b[i] + ",";
    22   return res;
    23 }
    24 mapfloor([1,2]);
    25 mapfloor([3,4]);
    26 assertEq(mapfloor([0x7ffffffa + 2.5, 0x7ffffffa + 20.5]), "2147483644,2147483662,");

mercurial