js/src/jit-test/tests/basic/testArrayInWithIndexedProto.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 testArrayInWithIndexedProto()
     2 {
     3     Array.prototype[0] = "Got me";
     4     var zeroPresent, zeroPresent2;
     5     // Need to go to 18 because in the failure mode this is
     6     // testing we have various side-exits in there due to interp and
     7     // tracer not agreeing that confuse the issue and cause us to not
     8     // hit the bad case within 9 iterations.
     9     for (var j = 0; j < 18; ++j) {
    10 	zeroPresent = 0 in [];
    11     }
    13     var arr = [1, 2];
    14     delete arr[0];
    15     for (var j = 0; j < 18; ++j) {
    16 	zeroPresent2 = 0 in arr;
    17     }
    18     return [zeroPresent, zeroPresent2];
    19 }
    21 var [ret, ret2] = testArrayInWithIndexedProto();
    22 assertEq(ret, true);
    23 assertEq(ret2, true);

mercurial