Unverified Commit fa5f5954 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4112 from dearblue/fix-outer-module-name

Fix outer module name
parents b7e5c866 292ea06d
...@@ -1701,7 +1701,8 @@ mrb_class_name(mrb_state *mrb, struct RClass* c) ...@@ -1701,7 +1701,8 @@ mrb_class_name(mrb_state *mrb, struct RClass* c)
{ {
mrb_value path = mrb_class_path(mrb, c); mrb_value path = mrb_class_path(mrb, c);
if (mrb_nil_p(path)) { if (mrb_nil_p(path)) {
path = mrb_str_new_lit(mrb, "#<Class:"); path = c->tt == MRB_TT_MODULE ? mrb_str_new_lit(mrb, "#<Module:") :
mrb_str_new_lit(mrb, "#<Class:");
mrb_str_concat(mrb, path, mrb_ptr_to_str(mrb, c)); mrb_str_concat(mrb, path, mrb_ptr_to_str(mrb, c));
mrb_str_cat_lit(mrb, path, ">"); mrb_str_cat_lit(mrb, path, ">");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment