js/src/tests/ecma_5/Object/proto-property-change-writability-set.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  * Contributors:
     5  *   Gary Kwong
     6  *   Jeff Walden
     7  *   Jason Orendorff
     8  */
    10 //-----------------------------------------------------------------------------
    11 var BUGNUMBER = 713944;
    12 var summary =
    13   "Don't assert anything about a shape from the property cache until it's " +
    14   "known the cache entry matches";
    16 print(BUGNUMBER + ": " + summary);
    18 /**************
    19  * BEGIN TEST *
    20  **************/
    22 var accDesc = { set: function() {} };
    23 var dataDesc = { value: 3 };
    25 function f()
    26 {
    27   propertyIsEnumerable = {};
    28 }
    29 function g()
    30 {
    31   propertyIsEnumerable = {};
    32 }
    34 Object.defineProperty(Object.prototype, "propertyIsEnumerable", accDesc);
    35 f();
    36 Object.defineProperty(Object.prototype, "propertyIsEnumerable", dataDesc);
    37 assertEq(propertyIsEnumerable, 3);
    38 f();
    39 assertEq(propertyIsEnumerable, 3);
    40 g();
    41 assertEq(propertyIsEnumerable, 3);
    45 var a = { p1: 1, p2: 2 };
    46 var b = Object.create(a);
    47 Object.defineProperty(a, "p1", {set: function () {}});
    48 for (var i = 0; i < 2; i++)
    49 {
    50   b.p1 = {};
    51   Object.defineProperty(a, "p1", {value: 3});
    52 }
    53 assertEq(b.p1, 3);
    54 assertEq(a.p1, 3);
    56 reportCompare(true, true);

mercurial