mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
change class argument of mrb_const_defined_at from struct RClass* to mrb_value to make it consistent with mrb_const_defined; ref #2593
This commit is contained in:
+2
-2
@@ -137,7 +137,7 @@ define_module(mrb_state *mrb, mrb_sym name, struct RClass *outer)
|
||||
{
|
||||
struct RClass *m;
|
||||
|
||||
if (mrb_const_defined_at(mrb, outer, name)) {
|
||||
if (mrb_const_defined_at(mrb, mrb_obj_value(outer), name)) {
|
||||
return module_from_sym(mrb, outer, name);
|
||||
}
|
||||
m = mrb_module_new(mrb);
|
||||
@@ -179,7 +179,7 @@ define_class(mrb_state *mrb, mrb_sym name, struct RClass *super, struct RClass *
|
||||
{
|
||||
struct RClass * c;
|
||||
|
||||
if (mrb_const_defined_at(mrb, outer, name)) {
|
||||
if (mrb_const_defined_at(mrb, mrb_obj_value(outer), name)) {
|
||||
c = class_from_sym(mrb, outer, name);
|
||||
if (super && mrb_class_real(c->super) != super) {
|
||||
mrb_raisef(mrb, E_TYPE_ERROR, "superclass mismatch for Class %S (%S not %S)",
|
||||
|
||||
Reference in New Issue
Block a user