Skip to main content
Paolo Olocco
Participating Frequently
December 11, 2025
Answered

CFML construction question for variables of type structure with comma

  • December 11, 2025
  • 2 replies
  • 257 views

In our development environment, we've started testing and deploying new code with CF2025.
However, our CI/CD is based on CF2023, as it's still in our production environments.
We've had a compilation error in our pipelines, which I'll summarize here:

<cfscript>
s = {
  key1 = 1,
}
writeDump(s);
</cfscript>

 

On CF2025: no reports
On CF2023 (or all other previous versions): an "Invalid CFML construct found" exception is received

 

In my opinion, the exception reporting handled so far in CF2023 is correct and is a bug to report in CF2025.

In your opinion, is it right or wrong?

    Correct answer BKBK

    @Paolo Olocco I have just noticed that it was an intentional change in ColdFusion 2025:
     
    https://helpx.adobe.com/coldfusion/using/whats-new.html

    https://coldfusion.adobe.com/2025/03/trailing-commas-in-coldfusion/

     

    The release documentation reads, "Trailing comma on last element in arrays: In previous versions, ColdFusion threw an error 500 when it encounters a trailing comma in certain code blocks. In the 2025 release of ColdFusion, you can add a trailing comma when creating arrays, structs, functions, parameters, and array/struct destructuring."

    2 replies

    BKBK
    Community Expert
    Community Expert
    December 12, 2025

    I have filed a bug ticket: https://tracker.adobe.com/#/view/CF-4229152

    <cfscript>
    testStruct = {"key1" = 1, };
    testArray = ["item1", ];
    writeDump(var=testStruct, label="Test Struct");
    writeDump(var=testArray, label="Test Array");
    </cfscript>

     

    • The code runs successfully on ColdFusion 2025 and on every version of Lucee since 4.5.
    • On every previous ColdFusion version, the code results in an error, thereby breaking backward compatibility.
    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    December 12, 2025

    @Paolo Olocco I have just noticed that it was an intentional change in ColdFusion 2025:
     
    https://helpx.adobe.com/coldfusion/using/whats-new.html

    https://coldfusion.adobe.com/2025/03/trailing-commas-in-coldfusion/

     

    The release documentation reads, "Trailing comma on last element in arrays: In previous versions, ColdFusion threw an error 500 when it encounters a trailing comma in certain code blocks. In the 2025 release of ColdFusion, you can add a trailing comma when creating arrays, structs, functions, parameters, and array/struct destructuring."

    BKBK
    Community Expert
    Community Expert
    December 11, 2025

    I agree with you. Like you, I think it's a bug in ColkdFusion 2025. You should report it.

    cfjedimaster
    Inspiring
    December 12, 2025

    This is absolutely _not_ a bug and is a QOL improvement - one JavaScript has as well. It lets you write code simpler, add and remove keys w/o worrying if you 'closed' off the final comma.