mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
enum.c (enum_chunk): Give proper error message if no block given. cf [ruby-core:25912]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a21b7ddf26
commit
51b89eeb03
1 changed files with 2 additions and 0 deletions
2
enum.c
2
enum.c
|
@ -2103,6 +2103,8 @@ enum_chunk(int argc, VALUE *argv, VALUE enumerable)
|
|||
VALUE initial_state;
|
||||
VALUE enumerator;
|
||||
|
||||
if(!rb_block_given_p())
|
||||
rb_raise(rb_eArgError, "no block given");
|
||||
rb_scan_args(argc, argv, "01", &initial_state);
|
||||
|
||||
enumerator = rb_obj_alloc(rb_cEnumerator);
|
||||
|
|
Loading…
Reference in a new issue