tracker issue : CF-3845963

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

listEach: arguments variable in UDF function (passed to listEach) should contain the information of delimiter and includeEmptyFields

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): / ext-user (Anuj Nawani)

Created: 10/31/2014

Components: Language, Functions

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: 289822 /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Win XP All

Vote Count: 1

Code snippet:
<cfscript>
list = "2|4";
list.each(function(){
	writeDump(arguments);
}, "|", true);
</cfscript>

Expected: The variable "arguments" should have information about delim and includeEmptyFields attribute and value passed to listEach function.
Actual: delim and includeEmptyFields information is missing.

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

Watson Bug ID:	3845963

External Customer Info:
External Company:  
External Customer Name:  
External Customer Email:

Attachments:

Comments:

+1. These functions need to be as uniform as possible. Pls make sure ALL the list iterations functions and methods implement this.
Vote by External U.
10366 | October 31, 2014 08:40:32 AM GMT
Excrement that it's been fixed. Now: when's it being released? Let's try to get some momentum going with find/fix/release.
Comment by External U.
10359 | November 01, 2014 01:24:16 PM GMT
Ooh! Sorry about that auto-corrupt there. Obviously (?) I meant "excellent"!
Comment by External U.
10360 | November 01, 2014 01:26:01 PM GMT
This hasn't been fixed at all in CF11 Update 3 (11,0,03,292024(PreRelease)). The arguments passed to the UDF of all the list iteration functions and methods are the same as they were in CF11 Final (11,0,0,289822). The arguments passed to the UDFs are: ---------------------------------------------------------- listEach/myList.listEach(): {1=item,2=index,3=list} (bug b/c missing: delimiter and includeEmptyElements) listMap/myList.listMap(): {1=item,2=index,3=list,4=delimiter,5=includeEmptyElements} listReduce/myList.listReduce(): {1=initialValue,2=item,3=index,4=list,5=delimiter,6=includeEmptyElements} listFilter/myList.listFilter(): {1=item} (bug b/c missing: index, list, delimiter, includeEmptyElements) Note: listFilter() didn't have an includeEmptyElements parameter in CF11.0 (but does in CF11HF3) Note: myList.filter() didn't exist in CF11.0 (but myList.listFilter() does in CF11HF3) Thanks!, -Aaron P.S. If UDF contains abort, then that works properly in the BIFs but throws an exception in the member functions (will file ticket)
Comment by External U.
10361 | November 14, 2014 04:32:23 AM GMT
Repro code (just uncomment each block and compare CF11.0 vs CF11HF3: <cfscript> function myFunction(){writeDump(ARGUMENTS); abort;}//abort triggers exception in member functions myList.listEach|listMap|listReduce|listFilter (but works fine in the built-in functions) /*myList = "b||a||c"; listEach(myList, myFunction, "|", true);//ARGUMENTS(CF11.0&CF11HF3): {1=item,2=index,3=list}*/ /*myList = "b||a||c"; myList.listEach(myFunction, "|", true);//ARGUMENTS(CF11.0&CF11HF3): {1=item,2=index,3=list}*/ /*myList = "b||a||c"; writeOutput(listMap(myList, myFunction, "|", true));//ARGUMENTS(CF11.0&CF11HF3): {1=item,2=index,3=list,4=delimiter,5=includeEmptyElements}*/ /*myList = "b||a||c"; writeOutput(myList.listMap(myFunction, "|", true));//ARGUMENTS(CF11.0&CF11HF3): {1=item,2=index,3=list,4=delimiter,5=includeEmptyElements}*/ /*myList = "b||a||c"; writeOutput(listReduce(myList, myFunction, 0, "|", true));//ARGUMENTS(CF11.0&CF11HF3): {1=initialValue,2=item,3=index,4=list,5=delimiter,6=includeEmptyElements}*/ /*myList = "b||a||c"; writeOutput(myList.listReduce(myFunction, 0, "|", true));//ARGUMENTS(CF11.0&CF11HF3): {1=initialValue,2=item,3=index,4=list,5=delimiter,6=includeEmptyElements}*/ /*myList = "b||a||c"; writeOutput(listFilter(myList, myFunction, "|", true));//ARGUMENTS(CF11.0&CF11HF3): {1=item}*/ /*myList = "b||a||c"; writeOutput(myList.listFilter(myFunction, "|", true));//ARGUMENTS(CF11.0): {1=item}*/ //Note: listFilter() didn't have an includeEmptyElements parameter in CF11.0 //Note: myList.filter() didn't exist in CF11.0 </cfscript>
Comment by External U.
10362 | November 14, 2014 04:34:16 AM GMT
Hi Anuj, This is mostly fixed in CF11 Update 3 (11,0,03,292245(PreRelease)). One issue remains: listFilter()/myList.listFilter(). Repro: myList = "b||a||c"; writeOutput(listFilter(myList, myFunction, "|", true));//only returns: item myList = "b||a||c"; writeOutput(myList.listFilter(myFunction, "|", true));//only returns: item Both should also return: index, list, delimiter and includeEmptyElements Thanks!, -Aaron
Comment by External U.
10363 | November 20, 2014 11:44:57 PM GMT
Forgot to include the function definition. Updated repro: function myFunction(){writeDump(ARGUMENTS); abort;} myList = "b||a||c"; writeOutput(listFilter(myList, myFunction, "|", true));//only returns: item myList = "b||a||c"; writeOutput(myList.listFilter(myFunction, "|", true));//only returns: item Thanks!, -Aaron
Comment by External U.
10364 | November 20, 2014 11:52:51 PM GMT
@Aaron, we have another bug for the same CF-3810965 and will be taken care.
Comment by Rupesh K.
10365 | November 21, 2014 12:32:53 AM GMT