Parameter execution sequence difference between Lucee and ACF

Hi All,

An observation here. It seems that Lucee evaluates parameters in right to left fashion and ACF2021 seems to evaluate parameters from Left to right fashion.

Dummy example
function(parameter1, parameter2, parameter3)
Lucee will evaluate parameter3 first while ACF2021 will evaluate parameter1 first.

Proper example (which intentionally throws an error)

        maskedUserEmail = replaceNoCase("", mid("c", 2, len("c")-2), repeatString("x",len("c")-2));

Error on Lucee
Parameter 2 of function repeatString which is now [-1] must be a non-negative integer on line 2

Error on ACF2021
The value of parameter 3 of the function Mid, which is now -1, must be a non-negative integer on line 2

Here is trycf gist:

I am not sure if this evaluation of parameters is intentional or not. I am also not sure if there is any impact of this change on coding.

Any thoughts?

I think the difference is actually that ACF throws an exception for this mid("c", 2, len("c")-2); while lucee does not:

If you change your example to this:
maskedUserEmail = replaceNoCase("", 5/0, repeatString("x",len("c")-2));

You’ll get the same error on both.

Pete Freitag
Foundeo Inc.


Same result for UDFs as well:

f( (()=>writeOutput('1'))(), (()=>writeOutput('2'))() )

Sorry, the IIFEs are a little ugly. I started with throw('param 1'), which Lucee was fine with, but Adobe CF choked on :roll_eyes: