js/src/jit-test/tests/basic/testConvertibleObjectEqUndefined.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 x4(v) { return "" + v + v + v + v; }
     2 function testConvertibleObjectEqUndefined()
     3 {
     4   var compares =
     5     [
     6      false, false, false, false,
     7      undefined, undefined, undefined, undefined,
     8      false, false, false, false,
     9      undefined, undefined, undefined, undefined,
    10      false, false, false, false,
    11      undefined, undefined, undefined, undefined,
    12      false, false, false, false,
    13      undefined, undefined, undefined, undefined,
    14      false, false, false, false,
    15      undefined, undefined, undefined, undefined,
    16     ];
    17   var count = 0;
    18   var obj = { valueOf: function() { count++; return 1; } };
    19   var results = compares.map(function(v) { return "unwritten"; });
    21   for (var i = 0, sz = compares.length; i < sz; i++)
    22     results[i] = compares[i] == obj;
    24   return results.join("") + count;
    25 }
    27 assertEq(testConvertibleObjectEqUndefined(),  
    28 	 x4(false) + x4(false) + x4(false) + x4(false) + x4(false) + x4(false) +
    29 	 x4(false) + x4(false) + x4(false) + x4(false) + "20");

mercurial