Index: test/webkit/array-index-immediate-types.js |
diff --git a/test/webkit/concat-while-having-a-bad-time.js b/test/webkit/array-index-immediate-types.js |
similarity index 75% |
copy from test/webkit/concat-while-having-a-bad-time.js |
copy to test/webkit/array-index-immediate-types.js |
index dfda1e08a0b36194b787a44ee12a9693acd8aeaf..7bacc9d0fc2751ed6b0f943e64a9993226b10d1c 100644 |
--- a/test/webkit/concat-while-having-a-bad-time.js |
+++ b/test/webkit/array-index-immediate-types.js |
@@ -22,10 +22,23 @@ |
// 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 test checks the behaviour of indexing an Array with immediate types." |
); |
-Object.defineProperty(Array.prototype, 0, { writable: false }); |
-shouldBe("[42].concat()", "[42]"); |
+var array = ["Zero", "One"]; |
+shouldBe("array[0]", '"Zero"'); |
+shouldBe("array[null]", "undefined"); |
+shouldBe("array[undefined]", "undefined"); |
+shouldBe("array[true]", "undefined"); |
+shouldBe("array[false]", "undefined"); |
+function putSelf(array, index) |
+{ |
+ index = index << 0; |
+ array[index] = index; |
+ return true; |
+} |
+ |
+shouldBeTrue("putSelf([0], 0);"); |
+shouldBeTrue("putSelf([0], 1/9);"); |