mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* proc.c (rb_mod_define_method): fix notation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c46ff1bb27
commit
3b8730058e
2 changed files with 12 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
|||
Sun Dec 20 11:01:57 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* proc.c (rb_mod_define_method): fix notation.
|
||||
|
||||
Sun Dec 20 10:54:15 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* proc.c (proc_new): fix notation.
|
||||
|
|
10
proc.c
10
proc.c
|
@ -1782,8 +1782,14 @@ rb_mod_define_method(int argc, VALUE *argv, VALUE mod)
|
|||
}
|
||||
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));
|
||||
|
|
Loading…
Reference in a new issue