mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Split visibility cases
This commit is contained in:
parent
52ef2477e4
commit
1351374bd1
1 changed files with 9 additions and 4 deletions
13
vm_method.c
13
vm_method.c
|
@ -1304,10 +1304,15 @@ rb_method_boundp(VALUE klass, ID id, int ex)
|
|||
}
|
||||
|
||||
if (me != NULL) {
|
||||
if ((ex & ~BOUND_RESPONDS) &&
|
||||
((METHOD_ENTRY_VISI(me) == METHOD_VISI_PRIVATE) ||
|
||||
((ex & BOUND_RESPONDS) && (METHOD_ENTRY_VISI(me) == METHOD_VISI_PROTECTED)))) {
|
||||
return 0;
|
||||
if (ex & ~BOUND_RESPONDS) {
|
||||
switch (METHOD_ENTRY_VISI(me)) {
|
||||
case METHOD_VISI_PRIVATE:
|
||||
return 0;
|
||||
case METHOD_VISI_PROTECTED:
|
||||
if (ex & BOUND_RESPONDS) return 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (me->def->type == VM_METHOD_TYPE_NOTIMPLEMENTED) {
|
||||
|
|
Loading…
Reference in a new issue