Index: test/webkit/array-sort-sparse.js |
diff --git a/test/webkit/concat-while-having-a-bad-time.js b/test/webkit/array-sort-sparse.js |
similarity index 82% |
copy from test/webkit/concat-while-having-a-bad-time.js |
copy to test/webkit/array-sort-sparse.js |
index dfda1e08a0b36194b787a44ee12a9693acd8aeaf..41a91f11bd3eeba4ea031c7f5aef17706600d124 100644 |
--- a/test/webkit/concat-while-having-a-bad-time.js |
+++ b/test/webkit/array-sort-sparse.js |
@@ -22,10 +22,14 @@ |
// 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." |
+"This tests that arrays and array like objects containing holes are sorted correctly." |
); |
-Object.defineProperty(Array.prototype, 0, { writable: false }); |
-shouldBe("[42].concat()", "[42]"); |
- |
+function testSort(x) |
+{ |
+ [].sort.call(x) |
+ return x[0] < x[1] && x[2] === undefined && !(3 in x) && x.length == 4; |
+} |
+shouldBeTrue("testSort([,undefined,0,1])"); |
+shouldBeTrue("testSort({length:4,1:undefined,2:0,3:1})"); |