main.to_s should also return "main"

This commit is contained in:
Yukihiro Matz Matsumoto
2013-03-26 22:25:58 +09:00
parent b1bd62e047
commit 66fa14a333
+1
View File
@@ -170,6 +170,7 @@ mrb_top_self(mrb_state *mrb)
if (!mrb->top_self) {
mrb->top_self = (struct RObject*)mrb_obj_alloc(mrb, MRB_TT_OBJECT, mrb->object_class);
mrb_define_singleton_method(mrb, mrb->top_self, "inspect", inspect_main, ARGS_NONE());
mrb_define_singleton_method(mrb, mrb->top_self, "to_s", inspect_main, ARGS_NONE());
}
return mrb_obj_value(mrb->top_self);
}