Better argument validation for core methods.
This commit is contained in:
@@ -10,16 +10,3 @@ IO.write(list[-4]) // expect: a
|
||||
IO.write(list[-3]) // expect: b
|
||||
IO.write(list[-2]) // expect: c
|
||||
IO.write(list[-1]) // expect: d
|
||||
|
||||
// Handle out of bounds.
|
||||
// TODO: Should halt the fiber or raise an error somehow.
|
||||
IO.write(list[4]) // expect: null
|
||||
IO.write(list[-5]) // expect: null
|
||||
|
||||
// Handle wrong argument type.
|
||||
// TODO: Should halt the fiber or raise an error somehow.
|
||||
IO.write(list[true]) // expect: null
|
||||
|
||||
// Handle non-integer index.
|
||||
// TODO: Should halt the fiber or raise an error somehow.
|
||||
IO.write(list[1.5]) // expect: null
|
||||
|
||||
Reference in New Issue
Block a user