1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* vm_method.c (rb_mod_method_defined): should return true or false.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-09-25 02:51:36 +00:00
parent ff54193c83
commit bc7123e434
2 changed files with 11 additions and 3 deletions

View file

@ -1,3 +1,7 @@
Fri Sep 25 11:51:34 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vm_method.c (rb_mod_method_defined): should return true or false.
Thu Sep 24 13:32:53 2009 Yukihiro Matsumoto <matz@ruby-lang.org> Thu Sep 24 13:32:53 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* proc.c (mnew): generate method object that wraps method_missing, * proc.c (mnew): generate method object that wraps method_missing,

View file

@ -671,7 +671,11 @@ rb_mod_undef_method(int argc, VALUE *argv, VALUE mod)
static VALUE static VALUE
rb_mod_method_defined(VALUE mod, VALUE mid) rb_mod_method_defined(VALUE mod, VALUE mid)
{ {
return rb_method_boundp(mod, rb_to_id(mid), 1); if (!rb_method_boundp(mod, rb_to_id(mid), 1)) {
return FALSE;
}
return TRUE;
} }
#define VISI_CHECK(x,f) (((x)&NOEX_MASK) == (f)) #define VISI_CHECK(x,f) (((x)&NOEX_MASK) == (f))
@ -1123,9 +1127,9 @@ basic_obj_respond_to(VALUE obj, ID id, int pub)
if (!rb_method_basic_definition_p(klass, respond_to_missing)) { if (!rb_method_basic_definition_p(klass, respond_to_missing)) {
return RTEST(rb_funcall(obj, respond_to_missing, pub ? 1 : 2, ID2SYM(id), Qtrue)); return RTEST(rb_funcall(obj, respond_to_missing, pub ? 1 : 2, ID2SYM(id), Qtrue));
} }
return Qfalse; return FALSE;
} }
return Qtrue; return TRUE;
} }
int int