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:
parent
095022cbe9
commit
ccebd9b016
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue