Index: test/mjsunit/array-splice.js |
diff --git a/test/mjsunit/array-splice.js b/test/mjsunit/array-splice.js |
index be2b1064e6a12f49d00e713a42b126a4eb45c485..f683350f52b43fa866faf3fc43f907f972a25e89 100644 |
--- a/test/mjsunit/array-splice.js |
+++ b/test/mjsunit/array-splice.js |
@@ -116,6 +116,11 @@ |
assertEquals([1, 2, 3, 4, 5, 6, 7], spliced); |
array = [1, 2, 3, 4, 5, 6, 7]; |
+ spliced = array.splice(-1e100); |
+ assertEquals([], array); |
+ assertEquals([1, 2, 3, 4, 5, 6, 7], spliced); |
+ |
+ array = [1, 2, 3, 4, 5, 6, 7]; |
spliced = array.splice(-3); |
assertEquals([1, 2, 3, 4], array); |
assertEquals([5, 6, 7], spliced); |
@@ -146,11 +151,21 @@ |
assertEquals([], spliced); |
array = [1, 2, 3, 4, 5, 6, 7]; |
+ spliced = array.splice(1e100); |
+ assertEquals([1, 2, 3, 4, 5, 6, 7], array); |
+ assertEquals([], spliced); |
+ |
+ array = [1, 2, 3, 4, 5, 6, 7]; |
spliced = array.splice(0, -100); |
assertEquals([1, 2, 3, 4, 5, 6, 7], array); |
assertEquals([], spliced); |
array = [1, 2, 3, 4, 5, 6, 7]; |
+ spliced = array.splice(0, -1e100); |
+ assertEquals([1, 2, 3, 4, 5, 6, 7], array); |
+ assertEquals([], spliced); |
+ |
+ array = [1, 2, 3, 4, 5, 6, 7]; |
spliced = array.splice(0, -3); |
assertEquals([1, 2, 3, 4, 5, 6, 7], array); |
assertEquals([], spliced); |
@@ -180,6 +195,11 @@ |
assertEquals([], array); |
assertEquals([1, 2, 3, 4, 5, 6, 7], spliced); |
+ array = [1, 2, 3, 4, 5, 6, 7]; |
+ spliced = array.splice(0, 1e100); |
+ assertEquals([], array); |
+ assertEquals([1, 2, 3, 4, 5, 6, 7], spliced); |
+ |
// Some exotic cases. |
obj = { toString: function() { throw 'Exception'; } }; |