Status/Resolution/Reason: Closed/Withdrawn/NotABug
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 03/09/2016
Components: Language
Versions: 2016
Failure Type: Unspecified
Found In Build/Fixed In Build: Alpha3_v12 /
Priority/Frequency: Trivial / Unknown
Locale/System: English / Win All
Vote Count: 1
ordered structs sort differently (A comes after AA), but should sort the same as unordered structs (A comes before AA)
Repro:
<cfscript>
unordered = {b=2, a=1, aa=1, c=3};
ordered = structNew("ordered");
ordered.b = 2;
ordered.a = 1;
ordered.aa = 1;
ordered.c = 3;
sortedDesc = unordered.sort("text", "desc");
writeDump(sortedDesc);
sortedDesc = unordered.sort(function(a1, a2) {
return sgn(a2-a1);
});
writeDump(sortedDesc);
sortedDesc = ordered.sort("text", "desc");
writeDump(sortedDesc);
sortedDesc = ordered.sort(function(a1, a2) {
return sgn(a2-a1);
});
writeDump(sortedDesc);
</cfscript>
Actual result:
['C', 'B', 'AA', 'A']
['C', 'B', 'AA', 'A']
['C', 'B', 'A', 'AA']
['C', 'B', 'A', 'AA']
Expected result:
['C', 'B', 'AA', 'A']
['C', 'B', 'AA', 'A']
['C', 'B', 'AA', 'A']
['C', 'B', 'AA', 'A']
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4126528
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email: adobelabs@itisdesign.com
External Test Config:
Attachments:
Comments: