tracker issue : CF-4202076

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

[ANeff] Bug for: slicing typed array does not preserve type

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

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

Created: 04/21/2018

Components: Language, CFSCRIPT

Versions: 2018

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2018.0.0.308164 / 2018,0,0,308771

Priority/Frequency: Normal / Some users will encounter

Locale/System: / Platforms All

Vote Count: 0

Issue: slicing typed array does not preserve type

Repro using array[:] (credit to John Whish):
  a1 = ["numeric"][1,2];
  a2 = a1[:]
  a2[3] = "foobar"

Actual Result: No exception thrown

Expected Result: coldfusion.runtime.ArrayInvalidTypeInsertException

Repro using array.slice():
  numeric[] function f(required numeric[] a) {return a}
  a3 = ["numeric"][1,2];
  a4 = a3.slice(1,2)
  a4[3] = "foobar"

Actual Results:
1) f(a4) does not trigger coldfusion.runtime.TypedArrayMethodArgumentException
2) a4[3]="foobar" does not trigger coldfusion.runtime.ArrayInvalidTypeInsertException

Expected Results:
1) f(a4) should trigger coldfusion.runtime.TypedArrayMethodArgumentException
2) a4[3]="foobar" should trigger coldfusion.runtime.ArrayInvalidTypeInsertException

Related thread: