Add ins_methods_type_i function
This commit is contained in:
parent
2d66f8e011
commit
54bfa0570d
Notes:
git
2025-06-06 00:31:58 +00:00
Merged: https://github.com/ruby/ruby/pull/4269 Merged-By: nobu <nobu@ruby-lang.org>
20
class.c
20
class.c
@ -1360,30 +1360,30 @@ ins_methods_i(st_data_t name, st_data_t type, st_data_t ary)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ins_methods_prot_i(st_data_t name, st_data_t type, st_data_t ary)
|
ins_methods_type_i(st_data_t name, st_data_t type, st_data_t ary, rb_method_visibility_t visi)
|
||||||
{
|
{
|
||||||
if ((rb_method_visibility_t)type == METHOD_VISI_PROTECTED) {
|
if ((rb_method_visibility_t)type == visi) {
|
||||||
ins_methods_push(name, ary);
|
ins_methods_push(name, ary);
|
||||||
}
|
}
|
||||||
return ST_CONTINUE;
|
return ST_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
ins_methods_prot_i(st_data_t name, st_data_t type, st_data_t ary)
|
||||||
|
{
|
||||||
|
return ins_methods_type_i(name, type, ary, METHOD_VISI_PROTECTED);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ins_methods_priv_i(st_data_t name, st_data_t type, st_data_t ary)
|
ins_methods_priv_i(st_data_t name, st_data_t type, st_data_t ary)
|
||||||
{
|
{
|
||||||
if ((rb_method_visibility_t)type == METHOD_VISI_PRIVATE) {
|
return ins_methods_type_i(name, type, ary, METHOD_VISI_PRIVATE);
|
||||||
ins_methods_push(name, ary);
|
|
||||||
}
|
|
||||||
return ST_CONTINUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ins_methods_pub_i(st_data_t name, st_data_t type, st_data_t ary)
|
ins_methods_pub_i(st_data_t name, st_data_t type, st_data_t ary)
|
||||||
{
|
{
|
||||||
if ((rb_method_visibility_t)type == METHOD_VISI_PUBLIC) {
|
return ins_methods_type_i(name, type, ary, METHOD_VISI_PUBLIC);
|
||||||
ins_methods_push(name, ary);
|
|
||||||
}
|
|
||||||
return ST_CONTINUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct method_entry_arg {
|
struct method_entry_arg {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user