Refine error message from mrb_get_arg1

#### Before this patch:

```console
$ bin/mruby -e '{}.key?'
trace (most recent call last):
-e:1: wrong number of arguments (ArgumentError)
```

#### After this patch:

```console
$ bin/mruby -e '{}.key?'
trace (most recent call last):
-e:1: wrong number of arguments (given 0, expected 1) (ArgumentError)
```
This commit is contained in:
KOBAYASHI Shuji
2020-12-29 19:04:19 +09:00
parent d44a1de8f4
commit 1fae7c0a69
+1 -1
View File
@@ -840,7 +840,7 @@ mrb_get_arg1(mrb_state *mrb)
array_argv = ARY_PTR(a);
}
if (argc != 1) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments");
mrb_argnum_error(mrb, argc, 1, 1);
}
return array_argv[0];
}