ArraySlice() validation doesn't correctly handle offset of 0

Description

The following code:

Throws the following error:

invalid call of the function arraySlice, third Argument (length) is invalid, Offset+length cannot be greater than size of the array

However, this is incorrect as the length argument is not the issue. And furthermore, the offset+length is not larger than the array. The offset argument is the issue as it cannot be zero.

Adobe ColdFusion does not have this issue as their error message makes a lot more sense:
https://trycf.com/gist/b161ccff2b38deea6a9f5dcc59f88372/acf2018?theme=monokai

The array has 5 indexes. Valid positions are from 1 to 5.
Cannot access array element at position 0.

Environment

None

Assignee

Michael Offner

Reporter

Brad Wood

Priority

New

Labels

None

Fix versions

None
Configure