tracker issue : CF-3042591

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

Bug 84831:[ANeff] Bug for: CF8 vs CF9 regarding local scope (another one)CF9 writes unscoped variables to variables scope *only if same-named local-scope'd variable wasn't previously defined*

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 10/26/2010

Components: Language, CF Component

Versions: 9.0.1

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 / 276147

Priority/Frequency: Major / Most users will encounter

Locale/System: English / Win All

Vote Count: 1

Problem:

[ANeff] Bug for: CF8 vs CF9 regarding local scope (another one)CF9 writes unscoped variables to variables scope *only if same-named local-scope'd variable wasn't previously defined*. (bug)CF8 writes unscoped variables to variables scope always. (correct)See Steps to Reproduce
Method:

<cffunction name="myFunction">
	<cfscript>
		local={};
		local.myVar = "one";
		//structDelete(local, "myVar");
		//not a workaround for this bug
		myVar = "two";
		//bug in CF9 (writes to function local scope, instead of variables scope)
	</cfscript>
	<cfdump var="#local#" />
	<cfdump var="#variables#" />
</cffunction>


<cfset myFunction() />
Result:

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

Watson Bug ID:	3042591

Deployment Phase:	Release Candidate

External Customer Info:
External Company:  
External Customer Name: Aaron Neff
External Customer Email: 3D1D17B03C844EBF992001AC
External Test Config: 10/26/2010

Attachments:

Comments: