[Webkit-unassigned] [Bug 135879] iOS 8 beta 5 Set forEach sometimes triggers wrong number of times

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 15 07:05:59 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=135879





--- Comment #10 from Ashley Gullen <ashley at scirra.com>  2014-08-15 07:06:07 PST ---
A new test case: http://www.scirra.com/labs/bugs/sbtestbug5/

This case is based off sbtestbug3, but additionally counts how many of the iterated items are reported as being in the Set using Set.has(). Here's the relevant code:

            for (var v of this.s)
                set_append_to_arr(v);

            if (current_index !== this.s["size"])
            {
                // Count how many items in the array are reported as being in the Set
                var i, count = 0;

                for (i = 0; i < current_index; ++i)
                {
                    if (this.s["has"](this.values_cache[i]))
                        ++count;
                }

                alert("Set for-of mismatch: iterated " + current_index + " times when Set size returns " + this.s["size"] + ". " + count + " of the iterated items are reported as being in the Set.");
            }

Interestingly, I get the following message on iOS 8 beta 5:

"Set for-of mismatch: iterated 4 times for when Set size returns 3. 2 of the iterated items are reported as being in the Set."

This is curious since I was expecting the count to be either 4 (for-of was correct, Set.size was incorrect) or 3 (for-of was incorrect, Set.size was correct). But the number of iterated items reported as being in the set is yet another different value. So neither value is correct, the internal structure of the Set must be invalid or corrupt or something.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list