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

vm_method.c: private

* vm_method.c (basic_obj_respond_to): call even if private.
  [Feature #6539]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-12-01 13:35:32 +00:00
parent 095022cbe9
commit ccebd9b016

View file

@ -1430,12 +1430,15 @@ static inline int
basic_obj_respond_to(VALUE obj, ID id, int pub)
{
VALUE klass = CLASS_OF(obj);
VALUE args[2];
switch (rb_method_boundp(klass, id, pub|NOEX_RESPONDS)) {
case 2:
return FALSE;
case 0:
return RTEST(rb_funcall(obj, respond_to_missing, 2, ID2SYM(id), pub ? Qfalse : Qtrue));
args[0] = ID2SYM(id);
args[1] = pub ? Qfalse : Qtrue;
return RTEST(rb_funcall2(obj, respond_to_missing, 2, args));
default:
return TRUE;
}