tracker issue : CF-4205066

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

[ANeff] ER for: Allow Array NoCase functions to search for any object case-insensitively

| View in Tracker

Status/Resolution/Reason: Open//

Reporter/Name(from Bugbase): Aaron N. / ()

Created: 08/28/2019

Components: Language, Functions

Versions: 2018

Failure Type:

Found In Build/Fixed In Build: /

Priority/Frequency: Normal /

Locale/System: / Platforms All

Vote Count: 0

This ER is to allow Array NoCase functions to search for any object case-insensitively.

History: CF-3316776 was fixed incorrectly, IMO. Searching for complex objects should've been fixed instead of removed.

Suggestion: If the 2nd parameter to the Array NoCase functions isn't a callback, then they should do JSON comparisons.

Pseudo code, using ArrayFindNoCase() as an example:

numeric function ArrayFindNoCase(required array array, required any value) {
	var result = 0;
	for(var i=1; i<=ARGUMENTS.array.len(); i++) {
		if(serializeJSON(ARGUMENTS.array[i]) == serializeJSON(value)) {
			result = i;
			break;
		}
	}
	return result;
}

This would fix Array's NoCase functions to behave as always expected, b/c searching case-insensitively for a non-simple value is just as useful as searching for it case-sensitively.

Related tickets: CF-3316776, CF-3335956 and CF-4202901

Attachments:

Comments:

Another related ticket: CF-4202905
Comment by Aaron N.
31235 | August 28, 2019 07:17:14 AM GMT