tracker issue : CF-3117508

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

Closures do not work with named arguments.

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Peter Boughton / Peter Boughton (Peter Boughton)

Created: 02/17/2012

Components: Language, Closures

Versions: 10.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: Public Beta / 281546

Priority/Frequency: Critical / All users will encounter

Locale/System: English / Platforms All

Vote Count: 0

Problem Description:
When passing a function into another function, closures do not work with named arguments.

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 );

// this one causes an error:
X = doStuff( SomeData='abc' , SomeFunction=function(){return Arguments[1] + Arguments[2];} );
</cfscript>



Actual Result:
Error: "Invalid construct: Either argument or name is missing."

Expected Result:

Any Workarounds:

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

Watson Bug ID:	3117508

External Customer Info:
External Company:  
External Customer Name: boughtonp
External Customer Email:  
External Test Config: CF10 Beta 1

Attachments:

Comments: