ruby-changes:41139
From: ko1 <ko1@a...>
Date: Sun, 20 Dec 2015 11:03:02 +0900 (JST)
Subject: [ruby-changes:41139] ko1:r53212 (trunk): * proc.c (rb_mod_define_method): fix notation.
ko1 2015-12-20 11:02:55 +0900 (Sun, 20 Dec 2015) New Revision: 53212 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53212 Log: * proc.c (rb_mod_define_method): fix notation. Modified files: trunk/ChangeLog trunk/proc.c Index: ChangeLog =================================================================== --- ChangeLog (revision 53211) +++ ChangeLog (revision 53212) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Dec 20 11:01:57 2015 Koichi Sasada <ko1@a...> + + * proc.c (rb_mod_define_method): fix notation. + Sun Dec 20 10:54:15 2015 Koichi Sasada <ko1@a...> * proc.c (proc_new): fix notation. Index: proc.c =================================================================== --- proc.c (revision 53211) +++ proc.c (revision 53212) @@ -1782,8 +1782,14 @@ rb_mod_define_method(int argc, VALUE *ar https://github.com/ruby/ruby/blob/trunk/proc.c#L1782 } else { body = argv[1]; - is_method = rb_obj_is_method(body) != Qfalse; - if (!is_method && !rb_obj_is_proc(body)) { + + if (rb_obj_is_method(body)) { + is_method = TRUE; + } + else if (rb_obj_is_proc(body)) { + is_method = FALSE; + } + else { rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc/Method)", rb_obj_classname(body)); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/