mirror of
https://github.com/janet-lang/janet
synced 2025-06-22 16:34:11 +00:00
Change function arity error message.
This commit is contained in:
parent
06c755c98a
commit
9cad4eb91d
@ -1195,9 +1195,11 @@ static void *op_lookup[255] = {
|
|||||||
/* Handle function calls with bad arity */
|
/* Handle function calls with bad arity */
|
||||||
vm_arity_error:
|
vm_arity_error:
|
||||||
{
|
{
|
||||||
retreg = dst_wrap_string(dst_formatc("calling %V got %d arguments, expected %d",
|
int32_t nargs = fiber->stacktop - fiber->stackstart;
|
||||||
|
retreg = dst_wrap_string(dst_formatc("%V called with %d argument%s, expected %d",
|
||||||
dst_wrap_function(func),
|
dst_wrap_function(func),
|
||||||
fiber->stacktop - fiber->stackstart,
|
nargs,
|
||||||
|
nargs == 1 ? "" : "s",
|
||||||
func->def->arity));
|
func->def->arity));
|
||||||
signal = DST_SIGNAL_ERROR;
|
signal = DST_SIGNAL_ERROR;
|
||||||
goto vm_exit;
|
goto vm_exit;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user