Title:
sort member functions should accept compare and compareNoCase functions as comparator callbacks
| View in TrackerStatus/Resolution/Reason: To Test//Fixed
Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron ()
Created: 04/30/2017
Components: Language, Functions
Versions: 2016
Failure Type: Others
Found In Build/Fixed In Build: ? /
Priority/Frequency: Normal /
Locale/System: / Platforms All
Vote Count: 2
See: http://blog.adamcameron.me/2017/04/cfml-lucee-13-v-4-14-v-6-coldfusion-we.html
This should work:
arrayToSort = ["d","C","b","A"];
arrayToSort.sort(compareNoCase);
It doesn't do anything (not even error).
This should also work:
listToSort = "d,C,b,A";
sortedList = listToSort.listSort(compareNoCase);
This one just errors:
You have specified invalid sorting inputs.
It could be a UDF functions or type.
That's not correct. A BIF should also work. More details & test cases in the blog article.
Attachments:
Comments: