Title:
Bug 78160:<cfset var local = {} /> within a method now created a attribute itn e variables scope instead of being ignored
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Paul Kukiel / Paul Kukiel (Paul Kukiel)
Created: 06/24/2009
Components: Legacy Area, CF Anywhere
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 / 239762
Priority/Frequency: Major / Unknown
Locale/System: English / Platforms All
Vote Count: 1
Problem:
<cfset var local = {} /> within a method now created a attribute itn e variables scope instead of being ignored. If a variable exisitns int e variables scope with the name local it will be overwritten from within a method.
According to the team this line should be ignored with the introduction of the new local scope.
Method:
Example.
<cfset var firstName= {} />
Should now go into the implicit local scope. Which it does as local.firstName.
But
<cfset var local = {} /> does not. It goes into the variables scope. This means if I had a cfc such as:
z.cfc
<cfcomponent output="false">
<cfset variables.local = "Big Ben" />
<cffunction name="init" returntype="z">
<cfset var local = {} />
<cfdump var="#variables#" />
<cfreturn this />
</cffunction>
</cfcomponent>
cfm:
<cfset temp = createObject("component","z").init() />
As soon as I run init() Big Ben is gone but in CF8 this would leave Big Ben alone.
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3039009
Deployment Phase: Release Candidate
External Customer Info:
External Company:
External Customer Name: Paul Kukiel
External Customer Email: 519130BF448F990A99201549
External Test Config: 06/24/2009
Attachments:
Comments: