Title:
Bug 84833:(Watson Migration Closure)[ANeff] Bug for: Clearing local scope odd behavior (ignore #84831)Please disregard #84831
| View in TrackerStatus/Resolution/Reason: Closed/Won't Fix/
Reporter/Name(from Bugbase): 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 /
Priority/Frequency: Normal / Unknown
Locale/System: English / Win All
Vote Count: 4
Problem:
[ANeff] Bug for: Clearing local scope odd behavior (ignore #84831)Please disregard #84831. The issue exists in both CF8 & CF9. After deleting a local variable (or even clearing the function local scope entirely), un-scoped assignment of same-named variable writes to local scope (instead of variables scope). This can be especially troublesome when using onRequest(), b/c an included page cannot use a same-named variable, even after calling structClear(local). Here are a couple of simplified examples:--------------1) CF9 Example--------------<cfscript> function myFunction() { var myVar=""; structDelete(local, "myVar", true);//ensure myVar does not exist in local scope structClear(local);//clear local scope entirely myVar="";//attempt to create variables.myVar writeOutput(variables.myVar);//ERROR: Element MYVAR is undefined in VARIABLES } myFunction();</cfscript>--------------------2) CF8 & CF9 Example--------------------<cfscript> function myFunction() { var myVar=""; structDelete(getPageContext().getActiveFunctionLocalScope(), "myVar", true);//ensure myVar does not exist in local scope structClear(getPageContext().getActiveFunctionLocalScope());//clear local scope entirely myVar="";//attempt to create variables.myVar writeOutput(variables.myVar);//ERROR: Element MYVAR is undefined in VARIABLES } myFunction();</cfscript>
Method:
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3042593
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email: 3D1D17B03C844EBF992001AC
External Test Config: 10/26/2010
Attachments:
Comments: