Title:
Implicit Array passed as named parameter to function in block ignores functions
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Justin Treher / Justin Treher (Justin Treher)
Created: 07/17/2014
Components: Core Runtime
Versions: 10.0
Failure Type:
Found In Build/Fixed In Build: Final /
Priority/Frequency: Normal / Most users will encounter
Locale/System: English / Win All
Vote Count: 0
Problem Description:
When you call a method passing an implicit array as a named parameter to a function inside of a conditional block (I haven't tested others), it will ignore any function call above that method call to the start of the block (easy to visualize with code below). Any code but a method call will cause it not to ignore. If this is executing outside of a block, it will correctly include the missing method.
Steps to Reproduce:
<cfscript>
testArrayBug();
function testArrayBug(){
if( true){
// this function will be ignored. If you move it below
// test ArrayBugSecond, it will show up.
testArrayBugFirst();
testArrayBugSecond(test =["one","two","three"]);
}
}
function testArrayBugFirst(array test = []){
writeDump(local);
}
function testArrayBugSecond(array test = []){
//do nothing
}
</cfscript>
Actual Result:
Black page.
Expected Result:
A dump of local.
Any Workarounds:
You can declare your array outside of the method call to get around the implicit array creation engine stripping out your function call. You can pass in arguments by position rather than named.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3790842
External Customer Info:
External Company:
External Customer Name: j_treher
External Customer Email:
External Test Config: IIS, ColdFusion 10
Attachments:
Comments: