tracker issue : CF-4152886

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] ER for: Fix StructSort()

| View in Tracker

Status/Resolution/Reason: Closed/Won't Fix/

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 05/13/2016

Components: Language, Functions

Versions: 2016

Failure Type: Enhancement Request

Found In Build/Fixed In Build: CF2016_Final /

Priority/Frequency: Trivial / Unknown

Locale/System: English / Platforms All

Vote Count: 0

ArraySort(myArray, ..) sorts myArray; QuerySort(myQuery, ..) sorts myQuery.

StructSort(myStruct, ..) does not sort myStruct, b/c the structSorted data type didn't exist until CF2016.

Since CF2016 introduced the structSorted data type, StructSort(myStruct, ..) should convert myStruct from struct to structSorted (and myStruct's value should be the result of the sort).

Note regarding backward-compat: Currently, StructSort(myStruct, ..) returns a sorted array of myStruct's key names. But, again, that is simply b/c StructSort() was introduced before the structSorted data type. Thus, a JVM flag should be introduced for code that needs to maintain backward-compat.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4152886

External Customer Info:
External Company:  
External Customer Name: Aaron Neff
External Customer Email:

Attachments:

Comments:

We agree that the behavior is inconsistent but introducing a JVM flag for this would definitely be an overkill when an alternative (using .toSorted function) is available.
Comment by Vamseekrishna N.
2811 | August 18, 2016 12:04:27 AM GMT
Hi Adobe, Technically, this could be fixed in cfscript 2.0. Could you please re-open to consider for Aether? Thanks!, -Aaron
Comment by Aaron N.
2812 | July 12, 2017 07:47:48 PM GMT