Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFML construction question for variables of type structure with comma

Explorer ,
Dec 11, 2025 Dec 11, 2025

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?

226
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 12, 2025 Dec 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, fun

...
Translate
Community Expert ,
Dec 11, 2025 Dec 11, 2025

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 12, 2025 Dec 12, 2025
LATEST

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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 12, 2025 Dec 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 12, 2025 Dec 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."

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources