tracker issue : CF-4198655

select a category, or use search below
(searches all categories and all time range)

Parser glitch on `+=`

| View in Tracker

Status/Resolution/Reason: To Fix//EnhancementRequired

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron ()

Created: 05/11/2017

Components: Language, Expressions

Versions: 2016,11.0

Failure Type: Others

Found In Build/Fixed In Build: ? /

Priority/Frequency: Normal /

Locale/System: / Platforms All

Vote Count: 1


maxRecordsToProcess = 40;
recordsAlreadyProcessed = 0;
recordsProcessedInThisTranche = 0;

writeOutput("About to do stuff<br>");
while ((recordsAlreadyProcessed += recordsProcessedInThisTranche) < maxRecordsToProcess){
    writeOutput("Doing stuff...<br>");
    recordsProcessedInThisTranche = 19;
writeOutput("Done stuff<br>");

This errors with:
Invalid CFML construct found on line 7 at column 33.

ColdFusion was looking at the following text:

It works fine on Lucee, and it *should* work fine.

I accept that it's unorthodox code, but *any* syntactically valid expression should be OK where an expression is called for, provided it evaluates to an appropriate value. Which it does in this case.