Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upArray.sort() sorted order invariant does not distinguish undefined and missing values #1271
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lukq commentedJul 22, 2018
The Array.sort() method specification gives steps that should be taken
The calls performed are implementation-dependent. Therefore, the next paragraph states what is the correctly sorted order.
Here, the second point does not distinguish values that are undefined and values that are missing from the array.
But the text phrasing in the part about the steps to be taken, and Note 1 in Runtime Semantics: SortCompare suggest that undefined values should be sorted before missing values. I suggest the sorted array invariant be rewritten to reflect this implicit requirement.