tracker issue : CF-3713043

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

listMap() doesn't pass correct args to callback

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 02/25/2014

Components: Language

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: PublicBeta /

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Platforms All

Vote Count: 0

See: http://cfmlblog.adamcameron.me/2014/02/coldfusion-11-map-and-reduce.html

{quote}
listMap() takes some other arguments I'm not using here: the list delimiter and a flag as to whether to respect empty list items (this is like most/all other list functions). But there's another slight glitch here: those values should also be passed to the callback, as they might be necessary for doing the element remapping.
{quote}

-- 
Adam

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

Watson Bug ID:	3713043

External Customer Info:
External Company:  
External Customer Name: Adam Cameron.
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

Now passing the delimiter and the flag as well in the callback function.
Comment by Rupesh K.
13222 | February 28, 2014 06:59:56 AM GMT
Cool. thanks Rupesh. -- Adam
Comment by External U.
13223 | February 28, 2014 07:13:28 AM GMT
Verified all good. Thanks mate.
Comment by External U.
13224 | April 30, 2014 07:13:39 AM GMT
This needs to be reopened. map() is fixed (and presume reduce() is), but you've not been very meticulous here... you've not fixed each(). Repro: list = "|2|4|"; list.each(function(){ writeDump(arguments); }, "|", true); Compare the output of that to what it should be (using map() as an example): newList = list.map(function(){ writeDump(arguments); }, "|", true); -- Adam
Comment by External U.
13225 | October 30, 2014 03:46:49 AM GMT
Have logged a separate bug CF-3845963 for listEach issue. (Comment added from ex-user id:nawani)
Comment by Adobe D.
13226 | October 31, 2014 08:29:24 AM GMT
Cheers mate! I'll go vote for that one.
Comment by External U.
13227 | October 31, 2014 08:39:58 AM GMT