michael@0: var seen = -1; michael@0: michael@0: // Test to make sure the jits get the number of calls, and return value michael@0: // of setters correct. We should not be affected by whether the setter michael@0: // modifies its argument or returns some value. michael@0: function setter(x) { michael@0: this.val = x; michael@0: x = 255; michael@0: bailout(); michael@0: seen++; michael@0: assertEq(seen, this.val); michael@0: return 5; michael@0: } michael@0: michael@0: function F(){} michael@0: Object.defineProperty(F.prototype, "value" , ({set: setter})); michael@0: michael@0: function test() { michael@0: var obj = new F(); michael@0: var itrCount = 10000; michael@0: for(var i = 0; i < itrCount; i++) { michael@0: assertEq(obj.value = i, i); michael@0: assertEq(obj.val, i); michael@0: } michael@0: } michael@0: test();