js/src/jit-test/tests/basic/testIn.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 testIn() {
     2     var array = [3];
     3     var obj = { "-1": 5, "1.7": 3, "foo": 5, "1": 7 };
     4     var a = [];
     5     for (let j = 0; j < 5; ++j) {
     6         a.push("0" in array);
     7         a.push(-1 in obj);
     8         a.push(1.7 in obj);
     9         a.push("foo" in obj);
    10         a.push(1 in obj);
    11         a.push("1" in array);
    12         a.push(-2 in obj);
    13         a.push(2.7 in obj);
    14         a.push("bar" in obj);
    15         a.push(2 in obj);
    16     }
    17     return a.join(",");
    18 }
    19 assertEq(testIn(), "true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,false,false,false,false,false");

mercurial