Status/Resolution/Reason: Closed/Withdrawn/AsDesigned
Reporter/Name(from Bugbase): Peter Boughton / Peter Boughton (Peter Boughton)
Created: 02/17/2012
Components: Language
Versions: 10.0
Failure Type: Non Functioning
Found In Build/Fixed In Build: Public Beta /
Priority/Frequency: Critical / All users will encounter
Locale/System: English / Platforms All
Vote Count: 1
Problem Description:
When attempting to define a function inline inside a cfset, it does not work.
Steps to Reproduce:
<cffunction name="doStuff">
<cfargument name="SomeData" />
<cfargument name="SomeFunction" />
<cfreturn arguments />
</cffunction>
<cffunction name="NormalFunc">
<cfreturn Arguments[1] + Arguments[2] />
</cffunction>
<cfscript>
// these three work:
X = doStuff( 'abc' , normalfunc );
X = doStuff( 'abc' , function(){return Arguments[1] + Arguments[2];} );
X = doStuff( SomeData='abc' , SomeFunction=normalfunc );
</cfscript>
<!--- passing in a function as a variable works, but using a closure does not work --->
<cfset X = doStuff( 'abc' , normalfunc ) />
<cfset X = doStuff( 'abc' , function(){return Arguments[1] + Arguments[2];} ) />
Actual Result:
Error: "Invalid CFML construct found" pointing at line/col of { character in closure definition
Expected Result:
A closure in cfset should work the same as in script.
Any Workarounds:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3117509
External Customer Info:
External Company:
External Customer Name: boughtonp
External Customer Email:
Attachments:
Comments: