mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Use mrb_name_error() as possible.
This commit is contained in:
+1
-1
@@ -979,7 +979,7 @@ mrb_method_search(mrb_state *mrb, struct RClass* c, mrb_sym mid)
|
||||
if (RSTRING_LEN(inspect) > 64) {
|
||||
inspect = mrb_any_to_s(mrb, mrb_obj_value(c));
|
||||
}
|
||||
mrb_raisef(mrb, E_NAME_ERROR, "undefined method '%S' for class %S",
|
||||
mrb_name_error(mrb, mid, "undefined method '%S' for class %S",
|
||||
mrb_sym2str(mrb, mid), inspect);
|
||||
}
|
||||
return m;
|
||||
|
||||
+2
-2
@@ -691,7 +691,7 @@ mrb_mod_cv_get(mrb_state *mrb, struct RClass * c, mrb_sym sym)
|
||||
}
|
||||
c = c->super;
|
||||
}
|
||||
mrb_raisef(mrb, E_NAME_ERROR, "uninitialized class variable %S in %S",
|
||||
mrb_name_error(mrb, sym, "uninitialized class variable %S in %S",
|
||||
mrb_sym2str(mrb, sym), cls);
|
||||
/* not reached */
|
||||
return mrb_nil_value();
|
||||
@@ -847,7 +847,7 @@ L_RETRY:
|
||||
}
|
||||
c = c->super;
|
||||
}
|
||||
mrb_raisef(mrb, E_NAME_ERROR, "uninitialized constant %S",
|
||||
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