diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-06-19 21:19:42 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-06-19 21:19:42 +0900 |
| commit | f678620a436aa015f9252858aa00112256ab0668 (patch) | |
| tree | 4a6da786a7ab691f063421560a09b36aca03783a /mrbgems | |
| parent | 1fca58f7ca63b6a7e372be75cab2da52725c26e7 (diff) | |
| parent | c40802865a756f97ec8ffbd2361864b1fa291d4e (diff) | |
| download | mruby-f678620a436aa015f9252858aa00112256ab0668.tar.gz mruby-f678620a436aa015f9252858aa00112256ab0668.zip | |
Merge branch 'dearblue-block_given'
Diffstat (limited to 'mrbgems')
| -rw-r--r-- | mrbgems/mruby-eval/src/eval.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/mrbgems/mruby-eval/src/eval.c b/mrbgems/mruby-eval/src/eval.c index dc0017e1c..66f4d5283 100644 --- a/mrbgems/mruby-eval/src/eval.c +++ b/mrbgems/mruby-eval/src/eval.c @@ -195,12 +195,7 @@ f_eval(mrb_state *mrb, mrb_value self) static mrb_value f_instance_eval(mrb_state *mrb, mrb_value self) { - mrb_value b; - mrb_int argc; const mrb_value *argv; - - mrb_get_args(mrb, "*!&", &argv, &argc, &b); - - if (mrb_nil_p(b)) { + if (!mrb_block_given_p(mrb)) { const char *s; mrb_int len; const char *file = NULL; @@ -217,7 +212,7 @@ f_instance_eval(mrb_state *mrb, mrb_value self) return exec_irep(mrb, self, proc, NULL); } else { - mrb_get_args(mrb, "&", &b); + mrb_get_args(mrb, ""); return mrb_obj_instance_eval(mrb, self); } } @@ -225,12 +220,7 @@ f_instance_eval(mrb_state *mrb, mrb_value self) static mrb_value f_class_eval(mrb_state *mrb, mrb_value self) { - mrb_value b; - mrb_int argc; const mrb_value *argv; - - mrb_get_args(mrb, "*!&", &argv, &argc, &b); - - if (mrb_nil_p(b)) { + if (!mrb_block_given_p(mrb)) { const char *s; mrb_int len; const char *file = NULL; @@ -245,7 +235,7 @@ f_class_eval(mrb_state *mrb, mrb_value self) return exec_irep(mrb, self, proc, NULL); } else { - mrb_get_args(mrb, "&", &b); + mrb_get_args(mrb, ""); return mrb_mod_module_eval(mrb, self); } } |
