js/src/jit-test/tests/basic/bug610592.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.

     2 /* Don't confuse JIT code by making slow arrays that use inline slots inconsistently. */
     4 function foo(a)
     5 {
     6   assertEq(a.x, 5);
     7 }
     9 function bar()
    10 {
    11   for (var i = 0; i < 50; i++) {
    12     var a = [];
    13     a[i] = 0;
    14     delete a[i];
    15     a.x = 5;
    16     foo(a);
    17   }
    19   var b = [1,,2,,3,,4,,5];
    20   assertEq(b.toString(), "1,,2,,3,,4,,5");
    21   b.x = 0;
    22   assertEq(b.toString(), "1,,2,,3,,4,,5");
    23   delete b.x;
    24   delete b[8];
    25   delete b[6];
    26   delete b[4];
    27   assertEq(b.toString(), "1,,2,,,,,,");
    28 }
    29 bar();

mercurial