CallStackGet()...function and GetFunctionCalled name-casing as compared to ACF.

Description

Consider this code;

<cfscript> any function retAny() { var cs1 = CallStackGet()[1]; writeoutput("<br>Function: " & GetFunctionCalledName() & " " & cs1.function); } retAny(); </cfscript>

Lucee 5

Function: RETANY retAny

Lucee 4.5

Function: retAny retAny

ACF 2018 & ACF 10

Function: retAny RETANY

Activity

Zac Spitzer 
1 July 2021 at 16:46
(edited)

Adam Cameron 
1 July 2021 at 16:12

I just got bitten by this in the current version of Lucee.

Sami Hoda 
7 April 2020 at 07:30

This bug has reared its ugly in the most unfortunate of circumstances. When building an API wrapper for Backblaze, I was using a 1 to 1 match function name to API endpoint. Meaning a function called getFile() would hit APIendpoint/getFile. I did so by using getFunctionCalledName and this worked, except when I would hit the same function multiple times, and it would return getFile, GETFILE… the uppercase version would break the API call since it expected it to be exact.

All in all, I think the expectation is that the function return the casing exactly as written. I don’t know why Lucee returns lowercase and uppercase sometimes, which makes it all more confusing. For now, I’ve overridden the behavior by using lcase, but this seems less than optimal.

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Priority

Created 22 November 2019 at 14:10
Updated 2 July 2021 at 09:57