js/src/tests/ecma_5/Object/15.2.3.4-03.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 /*
     2  * Any copyright is dedicated to the Public Domain.
     3  * http://creativecommons.org/licenses/publicdomain/
     4  * Contributor:
     5  *   Jeff Walden <jwalden+code@mit.edu>
     6  */
     8 //-----------------------------------------------------------------------------
     9 var BUGNUMBER = 518663;
    10 var summary = 'Object.getOwnPropertyNames: function objects';
    12 print(BUGNUMBER + ": " + summary);
    14 /**************
    15  * BEGIN TEST *
    16  **************/
    18 function two(a, b) { }
    20 assertEq(Object.getOwnPropertyNames(two).indexOf("length") >= 0, true);
    22 var bound0 = Function.prototype.bind
    23            ? two.bind("this")
    24            : function two(a, b) { };
    26 assertEq(Object.getOwnPropertyNames(bound0).indexOf("length") >= 0, true);
    27 assertEq(bound0.length, 2);
    29 var bound1 = Function.prototype.bind
    30            ? two.bind("this", 1)
    31            : function one(a) { };
    33 assertEq(Object.getOwnPropertyNames(bound1).indexOf("length") >= 0, true);
    34 assertEq(bound1.length, 1);
    36 var bound2 = Function.prototype.bind
    37            ? two.bind("this", 1, 2)
    38            : function zero() { };
    40 assertEq(Object.getOwnPropertyNames(bound2).indexOf("length") >= 0, true);
    41 assertEq(bound2.length, 0);
    43 var bound3 = Function.prototype.bind
    44            ? two.bind("this", 1, 2, 3)
    45            : function zero() { };
    47 assertEq(Object.getOwnPropertyNames(bound3).indexOf("length") >= 0, true);
    48 assertEq(bound3.length, 0);
    51 /******************************************************************************/
    53 reportCompare(true, true);
    55 print("All tests passed!");

mercurial