js/src/jit-test/tests/basic/bug754150.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 // |jit-test| error: TypeError;
     2 function printStatus (msg) {}
     3 function toPrinted(value) {
     4   value = value.replace(/\\n/g, 'NL')
     5 }
     6 function reportCompare (expected, actual, description) {
     7     printStatus ("Expected value '" + toPrinted(expected) +  "' matched actual value '" + toPrinted(actual) + "'");
     8 }
     9 var UBound = 0;
    10 var statusitems = [];
    11 var actual = '';
    12 var actualvalues = [];
    13 var expect= '';
    14 var expectedvalues = [];
    15 testThis('x()');
    16 testThis('"abc"()');
    17 testThis('x()');
    18 testThis('Date(12345)()');
    19 testThis('x()');
    20 testThis('1()');
    21 testThis('x()');
    22 testThis('void(0)()');
    23 testThis('x()');
    24 testThis('[1,2,3,4,5](1)');
    25 gczeal(4);
    26 testThis('x(1)');
    27 checkThis('(function (y) {return y+1;})("abc")');
    28 checkThis('f("abc")');
    29 function testThis(sInvalidSyntax) {
    30   expectedvalues[UBound] = expect;
    31   actualvalues[UBound] = actual;
    32   UBound++;
    33 }
    34 function checkThis(sValidSyntax) {
    35   for (var i=0; i<UBound; i++)
    36     reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
    37 }
    38 var actualvalues = [];
    39 for (var i=0; i<UBound; i++)
    40   reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);

mercurial