michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ michael@0: * Contributors: michael@0: * Gary Kwong michael@0: * Jeff Walden michael@0: * Jason Orendorff michael@0: */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 713944; michael@0: var summary = michael@0: "Don't assert anything about a shape from the property cache until it's " + michael@0: "known the cache entry matches"; michael@0: michael@0: print(BUGNUMBER + ": " + summary); michael@0: michael@0: /************** michael@0: * BEGIN TEST * michael@0: **************/ michael@0: michael@0: var accDesc = { set: function() {} }; michael@0: var dataDesc = { value: 3 }; michael@0: michael@0: function f() michael@0: { michael@0: propertyIsEnumerable = {}; michael@0: } michael@0: function g() michael@0: { michael@0: propertyIsEnumerable = {}; michael@0: } michael@0: michael@0: Object.defineProperty(Object.prototype, "propertyIsEnumerable", accDesc); michael@0: f(); michael@0: Object.defineProperty(Object.prototype, "propertyIsEnumerable", dataDesc); michael@0: assertEq(propertyIsEnumerable, 3); michael@0: f(); michael@0: assertEq(propertyIsEnumerable, 3); michael@0: g(); michael@0: assertEq(propertyIsEnumerable, 3); michael@0: michael@0: michael@0: michael@0: var a = { p1: 1, p2: 2 }; michael@0: var b = Object.create(a); michael@0: Object.defineProperty(a, "p1", {set: function () {}}); michael@0: for (var i = 0; i < 2; i++) michael@0: { michael@0: b.p1 = {}; michael@0: Object.defineProperty(a, "p1", {value: 3}); michael@0: } michael@0: assertEq(b.p1, 3); michael@0: assertEq(a.p1, 3); michael@0: michael@0: reportCompare(true, true);