mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
class.c (mrb_define_method_raw): take visibility from the class
If not explicitly specified in the method struct.
This commit is contained in:
+4
-1
@@ -779,7 +779,10 @@ mrb_define_method_raw(mrb_state *mrb, struct RClass *c, mrb_sym mid, mrb_method_
|
||||
else {
|
||||
ptr.func = MRB_METHOD_FUNC(m);
|
||||
}
|
||||
mt_put(mrb, h, mid, (MT_KEY_FLG(m.flags)&0xC)|MRB_VISIBILITY(c), ptr);
|
||||
|
||||
int flags = MT_KEY_FLG(m.flags);
|
||||
if ((flags & 0x3) == 0) flags |= MRB_VISIBILITY(c);
|
||||
mt_put(mrb, h, mid, flags, ptr);
|
||||
mc_clear_by_id(mrb, mid);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user