js/src/jit-test/tests/jaeger/inline/mathSqrt.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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