| description("Test to ensure correct behaviour of splice in array storage mode with indexed properties in the prototype chain."); |
| // Array storage shift holes require special behavior. |
| Object.prototype[trickyIndex] = trickyIndex; |
| for (var i = 0; i < a.length; ++i) { |
| a.shift(); // Converts to array storage mode. |
| for (var i = 0; i < startIndex; ++i) |
| shouldBe("a[" + i + "]", "" + (i + 1)); |
| for (var i = startIndex; i < a.length; ++i) |
| shouldBe("a[" + i + "]", "" + (i + 2)); |
| // Array storage shift holes require special behavior, but there aren't any holes. |
| for (var i = 0; i < b.length; ++i) |
| b.shift(); // Converts to array storage mode. |
| for (var i = 0; i < startIndex; ++i) |
| shouldBe("b[" + i + "]", "" + (i + 1)); |
| for (var i = startIndex; i < b.length; ++i) |
| shouldBe("b[" + i + "]", "" + (i + 2)); |