Title:
[ANeff] Bug for: CF2018's support for script arguments named 'default' is incomplete
| View in TrackerStatus/Resolution/Reason: To Fix//BugVerified
Reporter/Name(from Bugbase): Aaron N. / ()
Created: 08/04/2019
Components: Language, Functions
Versions: 2018
Failure Type: Incorrectly functioning
Found In Build/Fixed In Build: 2018,0,04,314546 /
Priority/Frequency: Normal / Few users will encounter
Locale/System: / Platforms All
Vote Count: 0
Issue: CF2018's support for script arguments named 'default' is incomplete. The fix was only applied to the 1st argument, whereas arguments 2+ still exhibit the undocumented CF9 behavior which we agreed during Aether to unsupport.
Steps to Reproduce:
<cfscript>
function f1(myType1 myName1, myType2 myName2){}
writeOutput(serializeJSON(f1.getMetadata().parameters[1]) & '<br>')
writeOutput(serializeJSON(f1.getMetadata().parameters[2]) & '<hr>')
function f2(myType1 myName1 default, myType2 myName2 default){}
writeOutput(serializeJSON(f2.getMetadata().parameters[1]) & '<br>')
writeOutput(serializeJSON(f2.getMetadata().parameters[2]) & '<hr>')
function f3(required myType1 myName1, required myType2 myName2){}
writeOutput(serializeJSON(f3.getMetadata().parameters[1]) & '<br>')
writeOutput(serializeJSON(f3.getMetadata().parameters[2]) & '<hr>')
function f4(required myType1 myName1 default, required myType2 myName2 default){}
writeOutput(serializeJSON(f4.getMetadata().parameters[1]) & '<br>')
writeOutput(serializeJSON(f4.getMetadata().parameters[2]))
</cfscript>
Actual Result:
{"REQUIRED":"false","TYPE":"myType1","NAME":"myName1"}
{"REQUIRED":"false","TYPE":"myType2","NAME":"myName2"}
----
{"REQUIRED":"false","TYPE":"myName1","NAME":"default"}
{"REQUIRED":"false","TYPE":"myType2","DEFAULT":"","NAME":"myName2"}
----
{"REQUIRED":"true","TYPE":"myType1","NAME":"myName1"}
{"REQUIRED":"true","TYPE":"myType2","NAME":"myName2"}
----
{"REQUIRED":"true","TYPE":"myName1","NAME":"default"}
{"REQUIRED":"true","TYPE":"myType2","DEFAULT":"","NAME":"myName2"}
Expected Result:
{"REQUIRED":"false","TYPE":"myType1","NAME":"myName1"}
{"REQUIRED":"false","TYPE":"myType2","NAME":"myName2"}
----
{"REQUIRED":"false","TYPE":"myType1","DEFAULT":"","NAME":"myName1"}
{"REQUIRED":"false","TYPE":"myType2","DEFAULT":"","NAME":"myName2"}
----
{"REQUIRED":"true","TYPE":"myType1","NAME":"myName1"}
{"REQUIRED":"true","TYPE":"myType2","NAME":"myName2"}
----
{"REQUIRED":"true","TYPE":"myType1","DEFAULT":"","NAME":"myName1"}
{"REQUIRED":"true","TYPE":"myType2","DEFAULT":"","NAME":"myName2"}
Attachments:
Comments: