Status: New
Owner: ----
New issue 626 by [email protected]: array.sort(function) should care
that the function is consistent
http://code.google.com/p/v8/issues/detail?id=626
re: http://www.robweir.com/blog/2010/02/microsoft-random-browser-
ballot.html
c++'s stl cares about ordering constraints (if the sort function isn't
consistent, it can cause segfaults).
ECMA-262 says: "If comparefn is not undefined and is not a consistent
comparison function for the elements of this array (see below), the
behaviour of sort is implementation-defined."
I would like the V8 implementation to care about consistency and not just
hide it from the user. Failing the sort would cause too much breakage, but
could it at least log an error?
I'm not sure if there's a good/quick/fast way to test for consistency, any
lazy check will probably not catch any math.random() implementations
properly.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev