js/src/tests/ecma_5/Date/toISOString.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 /*
     2  * Any copyright is dedicated to the Public Domain.
     3  * http://creativecommons.org/licenses/publicdomain/
     4  */
     6 function throwsRangeError(t) {
     7     try {
     8         var date = new Date();
     9         date.setTime(t);
    10         var r = date.toISOString();
    11         throw new Error("toISOString didn't throw, instead returned " + r);
    12     } catch (err) {
    13         assertEq(err instanceof RangeError, true, 'wrong error: ' + err);
    14         return;
    15     }
    16     assertEq(0, 1, 'not good, nyan, nyan');
    17 }
    19 throwsRangeError(Infinity);
    20 throwsRangeError(-Infinity);
    21 throwsRangeError(NaN);
    23 if (typeof reportCompare === "function")
    24   reportCompare(true, true);

mercurial