js/src/jit-test/tests/jaeger/inline/mathPow.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.pow(100, 2), 10000);
michael@0 3 assertEq(Math.pow(-Infinity, -0.5), 0);
michael@0 4 assertEq(Math.pow(-Infinity, 0.5), Infinity);
michael@0 5 assertEq(Math.pow(Infinity, -0.5), 0);
michael@0 6 assertEq(Math.pow(Infinity, 0.5), Infinity);
michael@0 7 assertEq(Math.pow(NaN, -0.5), NaN);
michael@0 8 assertEq(Math.pow(NaN, 0.5), NaN);
michael@0 9 assertEq(Math.pow(-3.14, -0.5), NaN);
michael@0 10 assertEq(Math.pow(-1.23, 0.5), NaN);
michael@0 11 assertEq(Math.pow(-0, -0.5), Infinity);
michael@0 12 assertEq(Math.pow(-0, 0.5), 0);
michael@0 13 assertEq(Math.pow(-1, -0.5), NaN);
michael@0 14 assertEq(Math.pow(-1, 0.5), NaN);
michael@0 15 assertEq(Math.pow(0, -0.5), Infinity);
michael@0 16 assertEq(Math.pow(0, 0.5), 0);
michael@0 17 assertEq(Math.pow(1, -0.5), 1);
michael@0 18 assertEq(Math.pow(1, 0.5), 1);
michael@0 19 assertEq(Math.pow(100, -0.5), 0.1);
michael@0 20 assertEq(Math.pow(100, 0.5), 10);
michael@0 21
michael@0 22 /* Inferred as pow(double, double). */
michael@0 23 function pow1(x) {
michael@0 24 return Math.pow(x, 0.5);
michael@0 25 }
michael@0 26 assertEq(pow1(100), 10);
michael@0 27 assertEq(pow1(144), 12);
michael@0 28 assertEq(pow1(-0), 0);
michael@0 29 assertEq(pow1(0), 0);
michael@0 30 assertEq(pow1(1), 1);
michael@0 31 assertEq(pow1(-1), NaN);
michael@0 32 assertEq(pow1(NaN), NaN);
michael@0 33 assertEq(pow1(-Infinity), Infinity);
michael@0 34 assertEq(pow1(Infinity), Infinity);
michael@0 35

mercurial