Before http://trac.webkit.org/projects/webkit/changeset/32220 the test ecma/Array/15.4.4.5-3.js passed, now returns: Failure messages were: testarr3[8] = Sat Jan 01 2000 00:00:00 GMT+0000 (GMT) FAILED! expected: Sat Jan 01 2000 00:00:00 GMT+0000 (GMT) testarr3[9] = Sat Jan 01 2000 00:00:00 GMT+0000 (GMT) FAILED! expected: Sat Jan 01 2000 00:00:00 GMT+0000 (GMT) This appears to be an issue with the array comparison, as the expected and actual results are identical.
This is a mistake in the test. In GMT time zone, the array being sorted happens to contain two identical dates, but different Date objects don't compare as equal even if the dates are the same, and Array.sort() is not guaranteed to be stable by ECMA-262. It used to be stable before r32220, but now we use std::sort instead of mergesort. We can either switch back to a stable sort, or fix the test. This test also fails in Firefox, so I think that fixing it would be appropriate.
Filed <https://bugzilla.mozilla.org/show_bug.cgi?id=430427>.
Created attachment 20767 [details] proposed fix
Comment on attachment 20767 [details] proposed fix r=me
Comment on attachment 20767 [details] proposed fix (Only half sarcastic.) But who's going to make the rest of the websites on the web resilient to sort instability?
Comment on attachment 20767 [details] proposed fix Well, yeah, my assumption was that Firefox performed non-stable sort, too, because it was also failing this test. But looks like it is not, and the reason for the failure in their case is that the compare function is broken. So, we'll have to fix both the implementation and the test.
Firefox bug about sort stability (fixed rather recently): <https://bugzilla.mozilla.org/show_bug.cgi?id=224128>.
Fixed in <http://trac.webkit.org/changeset/33967> (switched to a stable sort, and also fixed the test).