@@ -15,14 +15,16 @@ limitations under the License.
1515--]]
1616
1717local System = System
18+ local throw = System .throw
1819local Collection = System .Collection
1920local buildArray = Collection .buildArray
2021local getArray = Collection .getArray
2122local setArray = Collection .setArray
22- local checkIndex = Collection .checkIndex
2323local arrayEnumerator = Collection .arrayEnumerator
2424local findAll = Collection .findAllOfArray
2525
26+ local IndexOutOfRangeException = System .IndexOutOfRangeException
27+
2628local assert = assert
2729local select = select
2830local setmetatable = setmetatable
@@ -49,6 +51,13 @@ function Array.getLength(this)
4951 return # this
5052end
5153
54+ function Array .GetLength (this , dimension )
55+ if dimension ~= 0 then
56+ throw (IndexOutOfRangeException ())
57+ end
58+ return # this
59+ end
60+
5261function Array .getCount (this )
5362 return # this
5463end
@@ -141,13 +150,16 @@ function MultiArray.get(this, ...)
141150 return getArray (this , index )
142151end
143152
144- function MultiArray .getLength (this , dimension )
145- if dimension == nil then
146- return # this
147- end
153+ function MultiArray .getLength (this )
154+ return # this
155+ end
156+
157+ function MultiArray .GetLength (this , dimension )
148158 local rank = this .__rank__
149- checkIndex (rank , dimension )
150- return this .__rank__ [dimension + 1 ]
159+ if dimension < 0 or dimension >= # rank then
160+ throw (IndexOutOfRangeException ())
161+ end
162+ return rank [dimension + 1 ]
151163end
152164
153165function MultiArray .getRank (this )
0 commit comments