Commit 1fae7c0a authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

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)
```
parent d44a1de8
...@@ -840,7 +840,7 @@ mrb_get_arg1(mrb_state *mrb) ...@@ -840,7 +840,7 @@ mrb_get_arg1(mrb_state *mrb)
array_argv = ARY_PTR(a); array_argv = ARY_PTR(a);
} }
if (argc != 1) { if (argc != 1) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments"); mrb_argnum_error(mrb, argc, 1, 1);
} }
return array_argv[0]; return array_argv[0];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment