зеркало из https://github.com/github/ruby.git
* enumerator.c (enumerator_each): return self if no block is
given. [yarv-dev:882] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
7621057054
Коммит
d4cecea858
|
@ -1,3 +1,8 @@
|
|||
Tue Feb 14 20:26:00 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* enumerator.c (enumerator_each): return self if no block is
|
||||
given. [yarv-dev:882]
|
||||
|
||||
Tue Feb 14 18:48:33 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (DMETHOD_P): accessing wrong frame. [ruby-dev:28181]
|
||||
|
|
|
@ -314,10 +314,12 @@ rb_enumeratorize(VALUE obj, VALUE meth, int argc, VALUE *argv)
|
|||
static VALUE
|
||||
enumerator_each(VALUE obj)
|
||||
{
|
||||
struct enumerator *e = enumerator_ptr(obj);
|
||||
struct enumerator *e;
|
||||
int argc = 0;
|
||||
VALUE *argv = 0;
|
||||
|
||||
if (!rb_block_given_p()) return obj;
|
||||
e = enumerator_ptr(obj);
|
||||
if (e->args) {
|
||||
argc = RARRAY(e->args)->len;
|
||||
argv = RARRAY(e->args)->ptr;
|
||||
|
|
Загрузка…
Ссылка в новой задаче