tracker issue : CF-4190163

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

Parse error with += operator

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

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

Created: 09/17/2016

Components: Language

Versions: 2016

Failure Type:

Found In Build/Fixed In Build: CF2016_Update1 / 2018,0,0,303797

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Platforms All

Vote Count: 1

Repro:
{code:java}
<cfscript>
f = function(x,y){
	return x += y;
};

writeOutput(f(17, 19));
</cfscript>
{code}


Result on Lucee:
36

Result on CF2016:
C:\temp>cf shorthandAdd.cfm
Sep 17, 2016 20:09:54 PM Error [main] - Invalid CFML construct found on line 3 at column 18.
coldfusion.compiler.ParseException: Invalid CFML construct found on line 3 at column 18.

Note:
Equiv PHP and JS versions of the function both work same as Lucee, and this is the basis for my expectations.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4190163

External Customer Info:
External Company:  
External Customer Name: Adam Cameron
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

I tried running it using TryCF.com using CF10 & 11 (& Railo 4.2). They didn't work either, but Lucee 4.5 & 5 work Bugs like this are primarily why I haven't used cfscript everywhere yet.
Comment by External U.
1792 | September 17, 2016 11:11:34 AM GMT
This is a basic operation in other languages and also functions properly in a competing CF engine.
Vote by External U.
1793 | September 17, 2016 11:13:00 AM GMT