mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Not set a class/module name into anonymous class/module
This commit is contained in:
+5
-3
@@ -1069,8 +1069,10 @@ mrb_class_find_path(mrb_state *mrb, struct RClass *c)
|
||||
|
||||
str = mrb_sym2name_len(mrb, name, &len);
|
||||
mrb_str_cat(mrb, path, str, len);
|
||||
iv_del(mrb, c->iv, mrb_intern_lit(mrb, "__outer__"), NULL);
|
||||
iv_put(mrb, c->iv, mrb_intern_lit(mrb, "__classname__"), path);
|
||||
mrb_field_write_barrier_value(mrb, (struct RBasic*)c, path);
|
||||
if (RSTRING_PTR(path)[0] != '#') {
|
||||
iv_del(mrb, c->iv, mrb_intern_lit(mrb, "__outer__"), NULL);
|
||||
iv_put(mrb, c->iv, mrb_intern_lit(mrb, "__classname__"), path);
|
||||
mrb_field_write_barrier_value(mrb, (struct RBasic*)c, path);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user