| "Tests that defining a setter on the prototype of an object used for indexed storage works even if it is done after objects with indexed storage are allocated." |
| function foo(haveABadTime) { |
| for (var i = 0; i < result.length; ++i) { |
| debug("Henceforth I will have a bad time."); |
| Cons.prototype.__defineSetter__("3", function() { debug("Ouch!"); ouches++; }); |
| var expected = "\"0,1,2,3,4\""; |
| for (var i = 0; i < 1000; ++i) { |
| expected = "\"0,1,2,,4\""; |
| shouldBe("\"" + Array.prototype.join.apply(foo(haveABadTime), [","]) + "\"", expected); |
| shouldBe("ouches", "50"); |