js/src/tests/ecma_5/strict/regress-599159.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 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     3 /*
     4  * Any copyright is dedicated to the Public Domain.
     5  * http://creativecommons.org/licenses/publicdomain/
     6  */
     8 // Shu's test
     9 function test(makeNonArray) {
    10     function C() {}
    11     C.prototype = []
    12     if (makeNonArray)
    13         C.prototype.constructor = C
    14     c = new C();
    15     c.push("foo");
    16     return c.length
    17 }
    18 assertEq(test(true), 1);
    19 assertEq(test(false), 1);
    21 // jorendorff's longer test
    22 var a = [];
    23 a.slowify = 1;
    24 var b = Object.create(a);
    25 b.length = 12;
    26 assertEq(b.length, 12);
    28 // jorendorff's shorter test
    29 var b = Object.create(Array.prototype);
    30 b.length = 12;
    31 assertEq(b.length, 12);
    33 reportCompare(true, true);

mercurial