Status/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 05/12/2016
Components: Language, Member Functions
Versions: 2016
Failure Type: Enhancement Request
Found In Build/Fixed In Build: CF2016_Final / latest build
Priority/Frequency: Trivial / Unknown
Locale/System: English / Platforms All
Vote Count: 5
3844976 fixed .append() member functions to return a useful value for chaining. Same should be done for .sort() member functions.
Repro:
{code:java}
<cfscript>
a = ["a", "c", "b"];
s = {first={letter="a", number=1}, second={letter="b", number=2}, third={letter="c", number=3}};
q = queryNew("letter", "varchar", [["a"], ["c"], ["b"]]);
qUDF = function(r1, r2) {return compare(r1.letter, r2.letter);};
a.sort("text").each(function(e) {writeOutput(e);});
s.sort("text", "", "number").each(function(k,v,s) {writeOutput(v.letter);});
q.sort(qUDF).each(function(r) {writeOutput(r.letter);});
</cfscript>
{code}
Actual behavior:
- a.sort() example throws "The each method was not found."
- s.sort() example throws "An exception occurred while calling the function each."
- q.sort() example throws "The each method was not found."
Expected behavior: a.sort(), s.sort() and q.sort() examples should all return "abc"
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4152447
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email:
Attachments:
Comments: