class.c: call `method_added` hooks on alias definitions;
MODIFY
src/class.c
src/class.c
@@ -2282,6 +2282,8 @@ mrb_mod_to_s(mrb_state *mrb, mrb_value klass)
}
}
+void mrb_method_added(mrb_state *mrb, struct RClass *c, mrb_sym mid);
+
static mrb_value
mrb_mod_alias(mrb_state *mrb, mrb_value mod)
{
@@ -2290,6 +2292,7 @@ mrb_mod_alias(mrb_state *mrb, mrb_value mod)
mrb_get_args(mrb, "nn", &new_name, &old_name);
mrb_alias_method(mrb, c, new_name, old_name);
+ mrb_method_added(mrb, c, new_name);
return mod;
}

MODIFY
src/vm.c
src/vm.c
@@ -2921,6 +2921,7 @@ RETRY_TRY_BLOCK:
if (!check_target_class(mrb)) goto L_RAISE;
target = mrb_vm_ci_target_class(mrb->c->ci);
mrb_alias_method(mrb, target, syms[a], syms[b]);
+ mrb_method_added(mrb, target, syms[a]);
NEXT;
}
CASE(OP_UNDEF, B) {

class.c: call `method_added` hooks on alias definitions; #2339