mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #2264 from ksss/const_missing
const_missing error message more detail
This commit is contained in:
+10
-2
@@ -1890,8 +1890,16 @@ mrb_mod_const_missing(mrb_state *mrb, mrb_value mod)
|
||||
mrb_sym sym;
|
||||
|
||||
mrb_get_args(mrb, "n", &sym);
|
||||
mrb_name_error(mrb, sym, "uninitialized constant %S",
|
||||
mrb_sym2str(mrb, sym));
|
||||
|
||||
if (mrb_class_real(mrb_class_ptr(mod)) != mrb->object_class) {
|
||||
mrb_name_error(mrb, sym, "uninitialized constant %S::%S",
|
||||
mod,
|
||||
mrb_sym2str(mrb, sym));
|
||||
}
|
||||
else {
|
||||
mrb_name_error(mrb, sym, "uninitialized constant %S",
|
||||
mrb_sym2str(mrb, sym));
|
||||
}
|
||||
/* not reached */
|
||||
return mrb_nil_value();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user