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)

<cfscript>
        maskedUserEmail = replaceNoCase("axb@c.com", mid("c", 2, len("c")-2), repeatString("x",len("c")-2));
</cfscript>

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: TryCF.com

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

You’ll get the same error on both.

Pete Freitag
Foundeo Inc.

2 Likes

Same result for UDFs as well:

f=()=>{}
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: