mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
separate mrb_notimplement() and mrb_notimplement_m(); ref #2636
This commit is contained in:
+1
-1
@@ -221,7 +221,7 @@ MRB_API struct RClass * mrb_class_get(mrb_state *mrb, const char *name);
|
||||
MRB_API struct RClass * mrb_class_get_under(mrb_state *mrb, struct RClass *outer, const char *name);
|
||||
MRB_API struct RClass * mrb_module_get(mrb_state *mrb, const char *name);
|
||||
MRB_API struct RClass * mrb_module_get_under(mrb_state *mrb, struct RClass *outer, const char *name);
|
||||
MRB_API mrb_value mrb_notimplement(mrb_state*, mrb_value);
|
||||
MRB_API mrb_value mrb_notimplement_m(mrb_state*, mrb_value);
|
||||
|
||||
MRB_API mrb_value mrb_obj_dup(mrb_state *mrb, mrb_value obj);
|
||||
MRB_API mrb_value mrb_check_to_integer(mrb_state *mrb, mrb_value val, const char *method);
|
||||
|
||||
+11
-2
@@ -363,8 +363,9 @@ mrb_define_method_vm(mrb_state *mrb, struct RClass *c, mrb_sym name, mrb_value b
|
||||
}
|
||||
}
|
||||
|
||||
MRB_API mrb_value
|
||||
mrb_notimplement(mrb_state *mrb, mrb_value self)
|
||||
/* a function to raise NotImplementedError with current method name */
|
||||
MRB_API void
|
||||
mrb_notimplement(mrb_state *mrb)
|
||||
{
|
||||
const char *str;
|
||||
mrb_int len;
|
||||
@@ -376,6 +377,14 @@ mrb_notimplement(mrb_state *mrb, mrb_value self)
|
||||
"%S() function is unimplemented on this machine",
|
||||
mrb_str_new_static(mrb, str, (size_t)len));
|
||||
}
|
||||
}
|
||||
|
||||
/* a function to be replacement of unimplemented method */
|
||||
MRB_API mrb_value
|
||||
mrb_notimplement_m(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
mrb_notimplement(mrb);
|
||||
/* not reached */
|
||||
return mrb_nil_value();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user