Status/Resolution/Reason: To Fix//Investigate
Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)
Created: 09/09/2016
Components: Language, Functions
Versions: 2016
Failure Type: Enhancement Request
Found In Build/Fixed In Build: CF2016_Update1 /
Priority/Frequency: Trivial / Some users will encounter
Locale/System: English / Platforms All
Vote Count: 4
Repro:
<cfscript>
a = ["tahi", "rua", "toru", "wha"];
toUpperCase = function(s){
return s.ucase();
};
writeDump(a.map(toUpperCase));
// nope
try {
writeDump(a.map(ucase));
} catch (any e){
writeDump([e.message, e.detail]);
}
</cfscript>
Result:
array
1 TAHI
2 RUA
3 TORU
4 WHA
array
1 An exception occurred while calling the function map.
2 Cannot cast coldfusion.runtime.CFPageMethod to coldfusion.runtime.UDFMethod
You guys need to stop making stupid arbitrary distinctions between different types of functions (ref: http://blog.adamcameron.me/2012/12/am-i-right-to-think-this-is-stupid.html)
Anywhere you are making a distinguishment between UDFs, BIFs, functions-declared-by-statement or functions-declare-by-expression needs to be removed from the language. They're all just functions, and all should be usable interchangeably
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4188129
External Customer Info:
External Company:
External Customer Name: Adam Cameron
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: