JavaScriptCore:
authorkmccullough@apple.com <kmccullough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Jan 2008 18:28:43 +0000 (18:28 +0000)
committerkmccullough@apple.com <kmccullough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Jan 2008 18:28:43 +0000 (18:28 +0000)
        Reviewed by Oliver.

        -<rdar://problem/5622667> REGRESSION (Leopard-ToT): Endless loading loop
        trying to view techreport.com comments
        - We need to set values in the map, because if they are already in the
        map they will not be reset when we use add().

        * kjs/array_instance.cpp:
        (KJS::ArrayInstance::put):

LayoutTests:

        Reviewed by Oliver.

        - <rdar://problem/5622667> REGRESSION (Leopard-ToT): Endless loading
        loop trying to view techreport.com comments
        - Any resetting of a value in an array of sufficient size, would cause
        the second value to be lost.

        * fast/js/array-reset-large-index-expected.txt: Added.
        * fast/js/array-reset-large-index.html: Added.
        * fast/js/resources/array-reset-large-index.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29472 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/kjs/array_instance.cpp
LayoutTests/ChangeLog
LayoutTests/fast/js/array-reset-large-index-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/array-reset-large-index.html [new file with mode: 0644]
LayoutTests/fast/js/resources/array-reset-large-index.js [new file with mode: 0644]

index c416766..5bfd3da 100644 (file)
@@ -1,3 +1,15 @@
+2008-01-14  Kevin McCullough  <kmccullough@apple.com>
+
+        Reviewed by Oliver.
+
+        -<rdar://problem/5622667> REGRESSION (Leopard-ToT): Endless loading loop
+        trying to view techreport.com comments
+        - We need to set values in the map, because if they are already in the
+        map they will not be reset when we use add().
+
+        * kjs/array_instance.cpp:
+        (KJS::ArrayInstance::put):
+
 2008-01-14  Darin Adler  <darin@apple.com>
 
         Reviewed by Adam.
index 49c728e..0578ed7 100644 (file)
@@ -249,13 +249,13 @@ void ArrayInstance::put(ExecState* exec, unsigned i, JSValue* value, int attribu
             map = new SparseArrayValueMap;
             storage->m_sparseValueMap = map;
         }
-        map->add(i, value);
+        map->set(i, value);
         return;
     }
 
     unsigned newNumValuesInVector = storage->m_numValuesInVector + 1;
     if (!isDenseEnoughForVector(i + 1, newNumValuesInVector)) {
-        map->add(i, value);
+        map->set(i, value);
         return;
     }
 
index 424c9f1..c4903f1 100644 (file)
@@ -1,3 +1,16 @@
+2008-01-11  Kevin McCullough  <kmccullough@apple.com>
+
+        Reviewed by Oliver.
+
+        - <rdar://problem/5622667> REGRESSION (Leopard-ToT): Endless loading
+        loop trying to view techreport.com comments
+        - Any resetting of a value in an array of sufficient size, would cause
+        the second value to be lost.
+
+        * fast/js/array-reset-large-index-expected.txt: Added.
+        * fast/js/array-reset-large-index.html: Added.
+        * fast/js/resources/array-reset-large-index.js: Added.
+
 2008-01-14  Adam Roben  <aroben@apple.com>
 
         * platform/win/Skipped: Fixed a typo pointed out by Alexey.
@@ -8964,7 +8977,7 @@ to skip list since it is still failing on tiger.
 
         - test for http://bugs.webkit.org/show_bug.cgi?id=15181
           text-transform: uppercase not working in input (submit, reset, button) elements
-          <rdar://problem/5474647>
+          rdar://problem/5474647>
 
         * fast/forms/button-text-transform.html: Added.
         * platform/mac/fast/forms/button-text-transform-expected.checksum: Added.
diff --git a/LayoutTests/fast/js/array-reset-large-index-expected.txt b/LayoutTests/fast/js/array-reset-large-index-expected.txt
new file mode 100644 (file)
index 0000000..10d14e5
--- /dev/null
@@ -0,0 +1,11 @@
+This test puts an item in a big index and then tries to change it. It shoudl change successfully.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS array[10001] is 5
+PASS array[10002] is "b"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/js/array-reset-large-index.html b/LayoutTests/fast/js/array-reset-large-index.html
new file mode 100644 (file)
index 0000000..74da598
--- /dev/null
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="resources/js-test-style.css">
+<script src="resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/array-reset-large-index.js"></script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/js/resources/array-reset-large-index.js b/LayoutTests/fast/js/resources/array-reset-large-index.js
new file mode 100644 (file)
index 0000000..6901761
--- /dev/null
@@ -0,0 +1,14 @@
+description(
+"This test puts an item in a big index and then tries to change it. It shoudl change successfully."
+);
+
+var array = [];
+array[10001] = 0;
+array[10001] = 5;
+array[10002] = "a";
+array[10002] = "b";
+
+shouldBe('array[10001]', '5');
+shouldBe('array[10002]', '"b"');
+
+var successfullyParsed = true;