diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-09-17 08:40:03 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-09-17 08:40:03 +0900 |
| commit | cc636f334f21fbe06a735d9c98799d792d319017 (patch) | |
| tree | 514249bd0f4f472775622f28845e3040e22f715a /mrbgems/mruby-class-ext | |
| parent | d45c94fe1cda50d0dc22399d8e9d7f14bc9711dd (diff) | |
| parent | 099a4f3969b91d647a078d3148d8e4fedbf9c465 (diff) | |
| download | mruby-cc636f334f21fbe06a735d9c98799d792d319017.tar.gz mruby-cc636f334f21fbe06a735d9c98799d792d319017.zip | |
Merge pull request #4715 from dearblue/need-block
Entrust "no block given" error to `mrb_get_args()`
Diffstat (limited to 'mrbgems/mruby-class-ext')
| -rw-r--r-- | mrbgems/mruby-class-ext/src/class.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/mrbgems/mruby-class-ext/src/class.c b/mrbgems/mruby-class-ext/src/class.c index fdd56bcc3..255e62f6b 100644 --- a/mrbgems/mruby-class-ext/src/class.c +++ b/mrbgems/mruby-class-ext/src/class.c @@ -40,11 +40,7 @@ mrb_mod_module_exec(mrb_state *mrb, mrb_value self) mrb_int argc; mrb_value blk; - mrb_get_args(mrb, "*&", &argv, &argc, &blk); - - if (mrb_nil_p(blk)) { - mrb_raise(mrb, E_ARGUMENT_ERROR, "no block given"); - } + mrb_get_args(mrb, "*&!", &argv, &argc, &blk); mrb->c->ci->target_class = mrb_class_ptr(self); return mrb_yield_cont(mrb, blk, self, argc, argv); |
