js/src/jit-test/tests/ion/bug870356.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 function f1(x) {
     2     return Math.round(x);
     3 }
     4 assertEq(f1(3.3), 3);
     5 assertEq(f1(-2.842170943040401e-14), -0);
     7 function f2(x) {
     8     return Math.round(x);
     9 }
    10 assertEq(f2(3.3), 3);
    11 assertEq(f2(-1.3), -1);
    12 assertEq(f2(-1.8), -2);
    13 assertEq(f2(-0.9), -1);
    14 assertEq(f2(-0.6), -1);
    15 assertEq(f2(-0.4), -0);
    17 function f3(x) {
    18     return Math.round(x);
    19 }
    20 assertEq(f3(0.1), 0);
    21 assertEq(f3(-0.5), -0);
    23 function f4(x) {
    24     return Math.round(x);
    25 }
    26 assertEq(f4(0.1), 0);
    27 assertEq(f4(-0), -0);
    29 function f5(x) {
    30     return Math.round(x);
    31 }
    32 assertEq(f5(2.9), 3);
    33 assertEq(f5(NaN), NaN);

mercurial