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.

michael@0 1
michael@0 2 assertEq(Math.sqrt(-Infinity), NaN);
michael@0 3 assertEq(Math.sqrt(-3.14), NaN);
michael@0 4 assertEq(Math.sqrt(-2), NaN);
michael@0 5 assertEq(Math.sqrt(-0), -0);
michael@0 6 assertEq(Math.sqrt(0), 0);
michael@0 7 assertEq(Math.sqrt(2), Math.SQRT2);
michael@0 8 assertEq(Math.sqrt(49), 7);
michael@0 9 assertEq(Math.sqrt(Infinity), Infinity);
michael@0 10
michael@0 11 /* Inferred as sqrt(double). */
michael@0 12 function sqrt1(x) {
michael@0 13 return Math.sqrt(x);
michael@0 14 }
michael@0 15 assertEq(sqrt1(NaN), NaN);
michael@0 16 assertEq(sqrt1(-Infinity), NaN);
michael@0 17 assertEq(sqrt1(Infinity), Infinity);
michael@0 18 assertEq(sqrt1(-0), -0);
michael@0 19 assertEq(sqrt1(2), Math.SQRT2);
michael@0 20 assertEq(sqrt1(16), 4);
michael@0 21
michael@0 22 /* Inferred as sqrt(int). */
michael@0 23 function sqrt2(x) {
michael@0 24 return Math.sqrt(x);
michael@0 25 }
michael@0 26 assertEq(sqrt2(4), 2);
michael@0 27 assertEq(sqrt2(169), 13);
michael@0 28 assertEq(sqrt2(0), 0);
michael@0 29

mercurial