fix: validate builtin arity before argument access
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
IMPORT "lib/math.claro" AS math
|
||||
IMPORT "lib/random.claro" AS random
|
||||
|
||||
TRY
|
||||
CALL math.abs
|
||||
CATCH
|
||||
ENDTRY
|
||||
SAY LASTERROR
|
||||
|
||||
TRY
|
||||
CALL math.clamp WITH 1, 0
|
||||
CATCH
|
||||
ENDTRY
|
||||
SAY LASTERROR
|
||||
|
||||
TRY
|
||||
CALL random.seed
|
||||
CATCH
|
||||
ENDTRY
|
||||
SAY LASTERROR
|
||||
|
||||
TRY
|
||||
CALL random.int WITH 1
|
||||
CATCH
|
||||
ENDTRY
|
||||
SAY LASTERROR
|
||||
@@ -0,0 +1,4 @@
|
||||
math.abs needs 1 argument, but got 0. Try: CALL math.abs WITH value.
|
||||
math.clamp needs 3 arguments, but got 2. Try: CALL math.clamp WITH value, lower, upper.
|
||||
random.seed needs 1 argument, but got 0. Try: CALL random.seed WITH value.
|
||||
random.int needs 2 arguments, but got 1. Try: CALL random.int WITH lower, upper.
|
||||
Reference in New Issue
Block a user