js/src/jit-test/tests/jaeger/inline/mathSqrt.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 assertEq(Math.sqrt(-Infinity), NaN);
     3 assertEq(Math.sqrt(-3.14), NaN);
     4 assertEq(Math.sqrt(-2), NaN);
     5 assertEq(Math.sqrt(-0), -0);
     6 assertEq(Math.sqrt(0), 0);
     7 assertEq(Math.sqrt(2), Math.SQRT2);
     8 assertEq(Math.sqrt(49), 7);
     9 assertEq(Math.sqrt(Infinity), Infinity);
    11 /* Inferred as sqrt(double). */
    12 function sqrt1(x) {
    13     return Math.sqrt(x);
    14 }
    15 assertEq(sqrt1(NaN), NaN);
    16 assertEq(sqrt1(-Infinity), NaN);
    17 assertEq(sqrt1(Infinity), Infinity);
    18 assertEq(sqrt1(-0), -0);
    19 assertEq(sqrt1(2), Math.SQRT2);
    20 assertEq(sqrt1(16), 4);
    22 /* Inferred as sqrt(int). */
    23 function sqrt2(x) {
    24     return Math.sqrt(x);
    25 }
    26 assertEq(sqrt2(4), 2);
    27 assertEq(sqrt2(169), 13);
    28 assertEq(sqrt2(0), 0);

mercurial