michael@0: // Binary: cache/js-dbg-64-d066929dd830-linux michael@0: // Flags: -m michael@0: // michael@0: function fnSupportsArrayIndexGettersOnObjects() { michael@0: if (fnExists(Object.defineProperty)) { michael@0: var obj = {}; michael@0: Object.defineProperty(obj, "0", { michael@0: get: function () { michael@0: supportsArrayIndexGettersOnObjects = true; michael@0: } michael@0: }); michael@0: var res = obj[0]; michael@0: } michael@0: return supportsArrayIndexGettersOnObjects; michael@0: } michael@0: function fnExists( /*arguments*/ ) { michael@0: return true; michael@0: } michael@0: var ES5Harness = (function () { michael@0: var $this = this; michael@0: function registerTest(test) { michael@0: if (!(test.precondition && !test.precondition())) { michael@0: try { michael@0: var res = test.test.call($this); michael@0: } catch (e) {} michael@0: } michael@0: } michael@0: return { michael@0: registerTest: registerTest michael@0: } michael@0: })(); michael@0: ES5Harness.registerTest({ michael@0: test: function testcase() { michael@0: function callbackfn(accum, val, idx, obj) { michael@0: if (idx === 1 && val === 1) {} michael@0: } michael@0: var obj = { michael@0: length: 10 michael@0: }; michael@0: Object.defineProperty(obj, "0", { michael@0: get: function () { michael@0: defineProperty(idx, idx, registerTest + ": }}}}}"); michael@0: }, michael@0: }); michael@0: try { michael@0: Array.prototype.reduce.call(obj, callbackfn, "initialValue"); michael@0: } finally {} michael@0: }, michael@0: precondition: function prereq() { michael@0: return fnExists(Array.prototype.reduce) && fnExists(Object.defineProperty) && fnSupportsArrayIndexGettersOnObjects(); michael@0: } michael@0: }); michael@0: ES5Harness.registerTest({ michael@0: test: function testcase() { michael@0: var obj = {}; michael@0: Object.defineProperty(obj, "property", { michael@0: configurable: new Date() michael@0: }); michael@0: }, michael@0: precondition: function prereq() { michael@0: return fnExists(gczeal(2)); michael@0: } michael@0: });