js/src/tests/ecma_5/Object/15.2.3.12.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  */
     6 /* Object.isFrozen */
     8 assertEq(Object.isFrozen({}), false);
    10 assertEq(Object.isFrozen(Object.preventExtensions({})), true);
    12 var o = Object.defineProperty({}, 'x', { writable:true, configurable:true });
    13 Object.preventExtensions(o);
    14 assertEq(Object.isFrozen(o), false);
    16 var o = Object.defineProperty({}, 'x', { writable:false, configurable:true });
    17 Object.preventExtensions(o);
    18 assertEq(Object.isFrozen(o), false);
    20 var o = Object.defineProperty({}, 'x', { writable:true, configurable:false });
    21 Object.preventExtensions(o);
    22 assertEq(Object.isFrozen(o), false);
    24 var o = Object.defineProperty({}, 'x', { writable:false, configurable:false });
    25 assertEq(Object.isFrozen(o), false);
    27 var o = Object.defineProperty({}, 'x', { writable:false, configurable:false });
    28 Object.preventExtensions(o);
    29 assertEq(Object.isFrozen(o), true);
    31 var o = Object.defineProperties({}, { x: { writable:true,  configurable:true },
    32                                       y: { writable:false, configurable:false } });
    33 Object.preventExtensions(o);
    34 assertEq(Object.isFrozen(o), false);
    36 var o = Object.defineProperties({}, { x: { writable:false, configurable:false },
    37                                       y: { writable:true,  configurable:true } });
    38 Object.preventExtensions(o);
    39 assertEq(Object.isFrozen(o), false);
    41 var o = Object.defineProperties({}, { x: { writable:true,  configurable:true },
    42                                       y: { writable:true,  configurable:true } });
    43 Object.preventExtensions(o);
    44 assertEq(Object.isFrozen(o), false);
    46 reportCompare(true, true);

mercurial