[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
Thu Aug 14 09:52:44 PDT 2014


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





--- Comment #7 from Ashley Gullen <ashley at scirra.com>  2014-08-14 09:52:53 PST ---
New test cases:

http://www.scirra.com/labs/bugs/sbtestbug3/: replaces the following line

this.s["forEach"](set_append_to_arr);

with

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

consequence: early on alerts "Set forEach mismatch: iterated 4 times when Set size returns 3", always reproduces

http://www.scirra.com/labs/bugs/sbtestbug4/: same as sbtestbug2, but prepends the javascript code with

Set.prototype.forEach = function forEach(fn) {
    for (var value of this)
        fn(value);
};

consequence: early on (but later than sbtestbug3) alerts "Set forEach mismatch: iterated 14 times when Set size returns 13", always reproduces (but observed with different numbers, like 13 / 12), happens repeatedly afterwards with numbers like 15 / 14, 16 / 15, 17 / 16, after several alerts sometimes is two apart (16 / 14, 18 / 16)

It looks like the first occurrence is always off-by-one, with forEach triggering one more time than the set size reports. Since it also happens with for-of loops it doesn't appear limited to forEach.

-- 
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