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 /src/proc.c | |
| 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 'src/proc.c')
| -rw-r--r-- | src/proc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/proc.c b/src/proc.c index ca398384f..5283e5a3e 100644 --- a/src/proc.c +++ b/src/proc.c @@ -184,11 +184,8 @@ mrb_proc_s_new(mrb_state *mrb, mrb_value proc_class) mrb_value proc; struct RProc *p; - mrb_get_args(mrb, "&", &blk); - if (mrb_nil_p(blk)) { - /* Calling Proc.new without a block is not implemented yet */ - mrb_raise(mrb, E_ARGUMENT_ERROR, "tried to create Proc object without a block"); - } + /* Calling Proc.new without a block is not implemented yet */ + mrb_get_args(mrb, "&!", &blk); p = (struct RProc *)mrb_obj_alloc(mrb, MRB_TT_PROC, mrb_class_ptr(proc_class)); mrb_proc_copy(p, mrb_proc_ptr(blk)); proc = mrb_obj_value(p); |
