mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
included_modules, origin fix
Prepended modules would include their origin ICLASS
This commit is contained in:
+2
-1
@@ -1000,10 +1000,11 @@ mrb_mod_included_modules(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
mrb_value result;
|
||||
struct RClass *c = mrb_class_ptr(self);
|
||||
struct RClass *origin = c->origin;
|
||||
|
||||
result = mrb_ary_new(mrb);
|
||||
while (c) {
|
||||
if (c->tt == MRB_TT_ICLASS) {
|
||||
if (c != origin && c->tt == MRB_TT_ICLASS) {
|
||||
if (c->c->tt == MRB_TT_MODULE) {
|
||||
mrb_ary_push(mrb, result, mrb_obj_value(c->c));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user