tracker issue : CF-4202294

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] Bug for: invalid data types should not be allowed as valid array types

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Aaron Neff / ()

Created: 05/04/2018

Components: Language

Versions: 2018

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2018.0.01.308605 (PreRelease) / 2018,0,0,309059

Priority/Frequency: Normal / Very few users will encounter

Locale/System: / Platforms All

Vote Count: 0

Issue: invalid data types should not be allowed as valid array types

Repro:

<cfscript>
  values = [
    {label:'createDate(2018,1,2)',value:createDate(2018,1,2)},
    {label:'createTime(3,4,5)',value:createTime(3,4,5)},
    {label:'createDate(2018,1,2)+1',value:createDate(2018,1,2)+1},
    {label:'createTimeSpan(0,1,0,0)',value:createTimeSpan(0,1,0,0)},
    {label:'"2018-01-01"',value:"2018-01-01"},
    {label:'"12:00 AM"',value:"12:00 AM"},
    {label:'dateTimeFormat(createDate(2018,1,2), "iso")',value:dateTimeFormat(createDate(2018,1,2), "iso")}
  ]
  myTimeArray = ["time"][]
  myDateTimeArray = ["datetime"][]
  values.each(function(element,index) {
  	writeOutput("<p>")
  	try {
  		myTimeArray.append(element.value)
  		writeOutput('- ' & element.label & ' is a valid "time"<br>')
  	}
  	catch(any e) {
  		writeOutput('- ' & element.label & ' is not a valid "time"<br>')
  	}
  	try {
  		myDateTimeArray.append(element.value)
  		writeOutput('- ' & element.label & ' is a valid "datetime"<br>')
  	}
  	catch(any e) {
  		writeOutput('- ' & element.label & ' is not a valid "datetime"<br>')
  	}
  	writeOutput("</p>")
  })
</cfscript>

Actual Result:
-----------
- createDate(2018,1,2) is a valid "time"
- createDate(2018,1,2) is a valid "datetime"

- createTime(3,4,5) is a valid "time"
- createTime(3,4,5) is a valid "datetime"

- createDate(2018,1,2)+1 is not a valid "time"
- createDate(2018,1,2)+1 is not a valid "datetime"

- createTimeSpan(0,1,0,0) is not a valid "time"
- createTimeSpan(0,1,0,0) is not a valid "datetime"

- "2018-01-01" is a valid "time"
- "2018-01-01" is not a valid "datetime"

- "12:00 AM" is a valid "time"
- "12:00 AM" is not a valid "datetime"

- dateTimeFormat(createDate(2018,1,2), "iso") is a valid "time"
- dateTimeFormat(createDate(2018,1,2), "iso") is not a valid "datetime"
-----------

Expected Result: ["time"][] and ["datetime"][] should throw "coldfusion.runtime.TypedArrayInvalidDataTypeException" b/c 1) 'time' & 'datetime' are not valid CF data types and 2) ["integer"][] isn't being allowed.

Related tickets: CF-4202293 and CF-4202192

Attachments:

Comments:

Related thread: https://forums.adobeprerelease.com/coldfusionpr/discussion/379/cf-4202294-invalid-data-types-should-not-be-allowed-as-valid-array-types
Comment by Aaron N.
27658 | May 04, 2018 11:10:35 PM GMT
Related tickets: CF-4202192 and CF-4202293
Comment by Aaron N.
27659 | May 04, 2018 11:15:56 PM GMT