Can't call UDFs stored in an array inline

Description

This code example is from Adobe's new docs on arrow functions.
https://helpx.adobe.com/coldfusion/developing-applications/the-cfml-programming-language/extending-coldfusion-pages-with-cfml-scripting/using-closures.html#lambda

It runs on ACF 2018 update 5 but doesn't work on Lucee.

1 2 3 4 myarray = [ ()=>1, ()=>2 ] writedump( myarray ) writeOutput( myarray[ 1 ]() ) writeOutput( myarray[ 2 ]() )

Error message:

The function [1] does not exist in the Object, only the following functions are available: [append,avg,clear,contains,containsNoCase,delete,deleteAt,deleteNoCase,duplicate,each,...].

Lucee is not properly dereferencing the UDF from the array and is looking for a UDF actually called 1 which is incorrect.

Status

Assignee

Unassigned

Reporter

Brad Wood

Labels

None

Priority

New
Configure