js/src/jit-test/tests/arrow-functions/church-1.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 // Church booleans
     3 var True = t => f => t;
     4 var False = t => f => f;
     5 var bool_to_str = b => b("True")("False");
     6 var And = a => b => a(b)(a);
     7 var Or = a => b => a(a)(b);
     9 assertEq(And(True)(True), True);
    10 assertEq(And(True)(False), False);
    11 assertEq(And(False)(True), False);
    12 assertEq(And(False)(False), False);
    14 assertEq(Or(True)(True), True);
    15 assertEq(Or(True)(False), True);
    16 assertEq(Or(False)(True), True);
    17 assertEq(Or(False)(False), False);

mercurial