Index: test/mjsunit/array-unshift.js |
diff --git a/test/mjsunit/array-unshift.js b/test/mjsunit/array-unshift.js |
index 0eb299a0cee2a145396c2e7036d2237667c256c7..4d0c18e7e3de69a160be6fc23768854d05a93f39 100644 |
--- a/test/mjsunit/array-unshift.js |
+++ b/test/mjsunit/array-unshift.js |
@@ -194,7 +194,9 @@ |
(function() { |
for (var i = 0; i < 7; i++) { |
try { |
- new Array(Math.pow(2, 32) - 3).unshift(1, 2, 3, 4, 5); |
+ var a1 = []; |
+ a1[Math.pow(2, 32) - 3 - 1] = 0; |
+ a1.unshift(1, 2, 3, 4, 5); |
throw 'Should have thrown RangeError'; |
} catch (e) { |
assertTrue(e instanceof RangeError); |
@@ -202,7 +204,9 @@ |
// Check smi boundary |
var bigNum = (1 << 30) - 3; |
- assertEquals(bigNum + 7, new Array(bigNum).unshift(1, 2, 3, 4, 5, 6, 7)); |
+ var a2 = []; |
+ a2[bigNum - 1] = 0; |
+ assertEquals(bigNum + 7, a2.unshift(1, 2, 3, 4, 5, 6, 7)); |
} |
})(); |