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