Title:
Bug 78158:When using cfinvoke to call a method that returns void, and assigning a struct variable as the returnvariable, the result causes a key be created in the struct that contains 'undefined'
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/
Reporter/Name(from Bugbase): Rich Kroll / Rich Kroll (richkroll)
Created: 06/24/2009
Components: Language, Functions
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 9,0,0,233019 /
Priority/Frequency: Major / Unknown
Locale/System: English / Mac 10 All
Vote Count: 0
Problem:
When using cfinvoke to call a method that returns void, and assigning a struct variable as the returnvariable, the result causes a key be created in the struct that contains 'undefined'.
Method:
Create and invoke the demo.userit() method and you will see the dump display the struct containing an undefined key, yet it passes the structKeyExists check.
<!-- demo cfc -->
<cfcomponent>
<cffunction name="useit">
<cfset var refLocal = structNew() />
<cfset var component = createObject('component', 'Voider') />
<cfinvoke component="#component#" method="returnVoid" returnvariable="refLocal.results" />
<cfif structkeyexists(refLocal, "results")>
<!-- refLocal should not contain a results key as the component returns void -->
<cfdump var="#refLocal#">
</cfif>
</cffunction>
</cfcomponent>
<!-- voider.cfc -->
<cfcomponent>
<cffunction name="returnVoid" returntype="void">
</cffunction>
</cfcomponent>
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3039007
Deployment Phase: Release Candidate
External Customer Info:
External Company:
External Customer Name: Rich Kroll
External Customer Email: 2A5E34053CACB10F992001AC
External Test Config: 06/24/2009
Attachments:
Comments: