archives

« Bugzilla Issues Index

#4514 — 22.1.3.24 Array.prototype.sort: NaN and consistent comparison


22.1.3.24 Array.prototype.sort (comparefn)

Per the first bullet point in def. for "consistent comparison function", returning NaN makes the comparison function inconsistent. But NaN values are already special cased in SortCompare. Maybe def. for "consistent comparison function" should be changed to allow NaN values (and treat them like 0).