js/src/jit-test/tests/truthiness/if-strict-equal-null.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 var counterF = 0;
     3 function f(v, value)
     4 {
     5   if (v === null)
     6     counterF++;
     7   assertEq(counterF, value,
     8            "failed: " + v + " " + value);
     9 }
    11 f({}, 0);
    12 f({}, 0);
    13 f(null, 1);
    14 f(null, 2);
    15 f(undefined, 2);
    16 f(undefined, 2);
    17 f(objectEmulatingUndefined(), 2);
    18 f(objectEmulatingUndefined(), 2);
    19 f(Object.prototype, 2);
    20 f(Object.prototype, 2);
    22 var counterG = 0;
    24 function g(v, value)
    25 {
    26   if (v === null)
    27     counterG++;
    28   assertEq(counterG, value,
    29            "failed: " + v + " " + value);
    30 }
    32 g({}, 0);
    33 g({}, 0);
    35 var counterH = 0;
    37 function h(v, value)
    38 {
    39   if (v === null)
    40     counterH++;
    41   assertEq(counterH, value,
    42            "failed: " + v + " " + value);
    43 }
    45 h(objectEmulatingUndefined(), 0);
    46 h(objectEmulatingUndefined(), 0);

mercurial