Title:
Bug 79029:(Watson Migration Closure)Doing a StructCopy() on the arguments scope doesn't return a copy of the arguments scope - it simply returns the arguments scope
| View in TrackerStatus/Resolution/Reason: Closed/Won't Fix/LowImpact
Reporter/Name(from Bugbase): Mark Mandel / Mark Mandel (mark.mandel)
Created: 07/23/2009
Components: Language, Functions
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 /
Priority/Frequency: Major / Most users will encounter
Locale/System: English / Platforms All
Vote Count: 3
Problem:
Doing a StructCopy() on the arguments scope doesn't return a copy of the arguments scope - it simply returns the arguments scope.This is very confusing, as changes to the returned struct from StructCopy() also occur on the arguments scope, as it is a reference.
Method:
<cffunction name="testArguments" hint="" access="public" returntype="numeric" output="true"><cfargument name="input" hint="" type="Numeric" required="Yes"><cfscript>var args = StructCopy(arguments);args.input++; return arguments.input; </cfscript></cffunction><cfoutput>Output should be 10. #testArguments(10)#</cfoutput>
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3039414
External Customer Info:
External Company:
External Customer Name: Mark Mandel
External Customer Email: 3EA9517D445A9E8999201549
External Test Config: 07/23/2009
Attachments:
Comments: