Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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);