Scope order: local vs argument
Hi,
According to http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec09af4-7fdf.html, LOCAL variables take precedence to ARGUMENTS variables. However, when I access an unscoped variable in a CFC function that is available in both LOCAL and ARGUMENTS, I get back the ARGUMENTS scope. Why is that? I am using CF 9,0,0,251028.
<cfcomponent>
<cffunction name="testFunction" access="public" returntype="string">
<cfargument name="x" default="argument">
<cfset LOCAL.x = "local">
<cfreturn x />
</cffunction>
</cfcomponent><cfset obj = createObject( "component", "component.Test" )>
<cfoutput>#obj.testFunction("argument")#</cfoutput>
The output I get back is "argument" instead of "local".
The other thing that I find weird is that if I replace
<cfset LOCAL.x = "local">
with
<cfset var x = "var">
I get the error message "X is already defined in argument scope".
