Better argument validation for core methods.

This commit is contained in:
Bob Nystrom
2014-01-03 10:47:26 -08:00
parent a89386b4e8
commit 058c2606b0
23 changed files with 58 additions and 87 deletions
-5
View File
@@ -23,10 +23,5 @@ var f = [1, 2, 3]
f.removeAt(-1)
IO.write(f) // expect: [1, 2]
// Out of bounds.
// TODO: Signal error in better way.
IO.write([1, 2, 3].removeAt(3)) // expect: null
IO.write([1, 2, 3].removeAt(-4)) // expect: null
// Return the removed value.
IO.write([3, 4, 5].removeAt(1)) // expect: 4