js/src/jit-test/tests/basic/testStringify.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 function testStringify() {
     2     var t = true, f = false, u = undefined, n = 5, d = 5.5, s = "x";
     3     var a = [];
     4     for (var i = 0; i < 10; ++i) {
     5         a[0] = "" + t;
     6         a[1] = t + "";
     7         a[2] = "" + f;
     8         a[3] = f + "";
     9         a[4] = "" + u;
    10         a[5] = u + "";
    11         a[6] = "" + n;
    12         a[7] = n + "";
    13         a[8] = "" + d;
    14         a[9] = d + "";
    15         a[10] = "" + s;
    16         a[11] = s + "";
    17     }
    18     return a.join(",");
    19 }
    20 assertEq(testStringify(), "true,true,false,false,undefined,undefined,5,5,5.5,5.5,x,x");

mercurial