Title:
Compile error on passing shorthand array arguments to function in if ... else
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/
Reporter/Name(from Bugbase): Jan Verschueren / Jan Verschueren (Jan Verschueren)
Created: 02/24/2012
Components: Language, CF Component
Versions: 9.0.1
Failure Type: Crash
Found In Build/Fixed In Build: 9.0.1 /
Priority/Frequency: Critical / All users will encounter
Locale/System: English / Windows 7
Vote Count: 0
Problem Description:
When passing shorthand notation arrays to a function that is placed in an 'else' block, and the if ... else block is written without brackets, The server will throw a 500 internal server error.
It's important that a user-defined function is called in the 'else' block, that an shorthand array ([somevar]) is passed as an argument and that the if ... else block is used without brackets.
Steps to Reproduce:
copy or recreate following simple component code snippet:
component output="false"
{
remote void function init(){
if(1==2)
abort;
else
test(["hello"]);
}
function test(array values){
writeOutput(arguments.values[1]);
}
}
Actual Result:
500
Could not initialize class cftest012ecfc124438982
Expected Result:
hello
Any Workarounds:
- use brackets in if ... else
- don't pass shorthand array to test().
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3122719
External Customer Info:
External Company:
External Customer Name: Jan Verschueren
External Customer Email:
External Test Config: My Hardware and Environment details:
reproduced on Windows 7 & windows server 2003
Attachments:
- February 29, 2012 00:00:00: 1_500-result.txt
- February 29, 2012 00:00:00: 2_cf-error-result.txt
- February 29, 2012 00:00:00: 3_500-snippet.txt
- February 29, 2012 00:00:00: 4_cf-error-snippet.txt
- February 29, 2012 00:00:00: 6_cf-error-result-cfm.txt
- February 29, 2012 00:00:00: 7_cf-cfm.txt
- February 29, 2012 00:00:00: 5_cf-error-result-cfm.txt
Comments: