tracker issue : CF-4198655

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

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

Repro:
https://trycf.com/gist/dc084b568973c95eed2d3e012e956380/acf2016?theme=monokai


{code:java}
<cfscript>
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>");
</cfscript>
{code}


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.

Attachments:

Comments: