tracker issue : CF-3120857

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

Cannot call function expression from struct["property"] notation

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): Tyler Clendenin / Tyler Clendenin (tylerc)

Created: 02/22/2012

Components: Language, Closures

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 / Mac 10.7 64-bit

Vote Count: 0

Duplicate ID:	CF-3041263

Problem Description: If a function expression is set to a structure and referenced with the bracket notation it cannot be run.

Steps to Reproduce:

<cfscript>
test=structNew();
test.one=function(){ return 1; };
test["two"]=function(){ return 2; };
</cfscript>
<cfoutput>
#test.one()##test["two"]()#
</cfoutput>

Actual Result:

Invalid CFML construct found on line 7 at column 25.

ColdFusion was looking at the following text:
(

The CFML compiler was processing:

An expression that began on line 7, column 13.
The expression might be missing an ending #, for example, #expr instead of #expr#.
The body of a cfoutput tag beginning on line 6, column 2.

Expected Result:

Any Workarounds:

Using invoke i.e. invoke(struct, "property").

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

Watson Bug ID:	3120857

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

Attachments:

Comments: