Better argument validation for some list methods.

This commit is contained in:
Bob Nystrom
2014-01-02 07:32:00 -08:00
parent a0c32f2e6e
commit a89386b4e8
25 changed files with 133 additions and 65 deletions
+1
View File
@@ -0,0 +1 @@
1 / false // expect runtime error: Right operand must be a number.
@@ -1 +0,0 @@
1 / false // expect runtime error: TypeError: Right operand must be Num.
+1
View File
@@ -0,0 +1 @@
1 - false // expect runtime error: Right operand must be a number.
@@ -1 +0,0 @@
1 - false // expect runtime error: TypeError: Right operand must be Num.
+1
View File
@@ -0,0 +1 @@
1 % false // expect runtime error: Right operand must be a number.
-1
View File
@@ -1 +0,0 @@
1 % false // expect runtime error: TypeError: Right operand must be Num.
@@ -0,0 +1 @@
1 * false // expect runtime error: Right operand must be a number.
@@ -1 +0,0 @@
1 * false // expect runtime error: TypeError: Right operand must be Num.
+3
View File
@@ -0,0 +1,3 @@
1 + false // expect runtime error: Right operand must be a number.
// TODO: What about a string on the RHS?
@@ -1,3 +0,0 @@
1 + false // expect runtime error: TypeError: Right operand must be Num.
// TODO: What about a string on the RHS?