js/src/jit-test/tests/truthiness/equal-undefined.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 f(v, value)
     2 {
     3   var b = v == undefined;
     4   assertEq(b, value,
     5            "failed: " + v + " " + value);
     6 }
     8 f({}, false);
     9 f({}, false);
    10 f(null, true);
    11 f(null, true);
    12 f(undefined, true);
    13 f(undefined, true);
    14 f(objectEmulatingUndefined(), true);
    15 f(objectEmulatingUndefined(), true);
    16 f(Object.prototype, false);
    17 f(Object.prototype, false);
    19 function g(v, value)
    20 {
    21   var b = v == undefined;
    22   assertEq(b, value,
    23            "failed: " + v + " " + value);
    24 }
    26 g({}, false);
    27 g({}, false);
    29 function h(v, value)
    30 {
    31   var b = v == undefined;
    32   assertEq(b, value,
    33            "failed: " + v + " " + value);
    34 }
    36 h(objectEmulatingUndefined(), true);
    37 h(objectEmulatingUndefined(), true);

mercurial