1
0
Fork 0
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:
marcandre 2009-10-03 04:55:00 +00:00
parent a21b7ddf26
commit 51b89eeb03

2
enum.c
View file

@ -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);