]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/sparse_splice.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / sparse_splice.js
diff --git a/tests/stress/sparse_splice.js b/tests/stress/sparse_splice.js
new file mode 100644 (file)
index 0000000..6565dd4
--- /dev/null
@@ -0,0 +1,12 @@
+var myArray = Array();
+myArray[ 10000 ] = "a";
+myArray[ 10001 ] = "b";
+myArray[ 10002 ] = "c";
+
+// remove element at index 1001
+myArray.splice( 10001, 1 );
+
+if (myArray[10000] != "a")
+    throw "Splicing Error! start index changed";
+if (myArray[10001] != "c")
+    throw "Splicing Error! removed element not removed";