| description("Regresion test for 155776. This test should pass and not crash."); |
| function fillBigArrayViaToString(n) { |
| for (var i = 0; i < n; i++) |
| fillBigArrayViaToString.toString(); |
| Function.prototype.toString = function(x) { |
| if (toStringCount == 2000) { |
| var newArray = new Uint32Array(8000); |
| for (var i = 0; i < newArray.length; i++) |
| newArray[i] = 0x10000000; |
| bigArray.push(fillBigArrayViaToString); |
| bigArray.push(fillBigArrayViaToString); |
| bigArray.push(fillBigArrayViaToString); |
| fillBigArrayViaToString(4000).join(); |
| var stringResult = bigArray.join(":"); |
| for (var i = 0; i < 1000; i++) { |
| expectedArray.push(smallNum); |
| expectedArray.push(bigNum); |
| expectedArray.push(bigNum); |
| expectedArray.push(bigNum); |
| var expectedString = expectedArray.join(":"); |
| shouldBe('stringResult', 'expectedString'); |