Sorting arrays with more than 10,000 elements leaves elements beyond 10,000 undefined. Loading the attached html file in Safari 2 and 3 (419.3 on OS X 10.4.8 and 522.11.3 on Windows XP) gives me the following: Test Result test length: 10010 test[9999]: 9999 test[10000]: 10000 test[9990:10010]: [9990, 9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009] sorting array test length: 10010 test[9999]: 9999 test[10000]: undefined test[9990:10010]: [9990, 9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999, , , , , , , , , , ] While Firefox and IE both give me: Test Result test length: 10010 test[9999]: 9999 test[10000]: 10000 test[9990:10010]: [9990, 9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009] sorting array test length: 10010 test[9999]: 9999 test[10000]: 10000 test[9990:10010]: [9990, 9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009]
Created attachment 15012 [details] test case
From memory, at around 10,000 elements we change both sorting algorithm and move to a sparse array implementation. Either one of these may be the root of this issue.
I'll have a look into this.
Created attachment 15013 [details] patch with test case and change log
Committed revision 23521.