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.

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

mercurial