Index: test/webkit/array-sort-small-sparse-array-with-large-length.js |
diff --git a/test/webkit/concat-while-having-a-bad-time.js b/test/webkit/array-sort-small-sparse-array-with-large-length.js |
similarity index 79% |
copy from test/webkit/concat-while-having-a-bad-time.js |
copy to test/webkit/array-sort-small-sparse-array-with-large-length.js |
index dfda1e08a0b36194b787a44ee12a9693acd8aeaf..05478d6f8ca2117838ae59702e01ea6d76e19fa7 100644 |
--- a/test/webkit/concat-while-having-a-bad-time.js |
+++ b/test/webkit/array-sort-small-sparse-array-with-large-length.js |
@@ -22,10 +22,19 @@ |
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
description( |
-"Tests the behavior of Array.prototype.concat while the array is having a bad time due to one of the elements we are concatenating." |
+"Tests that we can quickly sort a small sparse array that has a large length." |
); |
-Object.defineProperty(Array.prototype, 0, { writable: false }); |
-shouldBe("[42].concat()", "[42]"); |
- |
- |
+var array = []; |
+array[10000000] = 42; |
+array.sort(); |
+var result = ""; |
+for (var s in array) { |
+ debug("array[" + s + "] = " + array[s]); |
+ if (result) |
+ result += ","; |
+ result += array[s]; |
+} |
+shouldBe("result", "\"42\""); |
+shouldBe("array.length", "10000001"); |
+shouldBe("array[0]", "42"); |