Remove incorrect removal of iv

This commit is contained in:
Carson McDonald
2013-06-09 07:50:07 -04:00
parent 01c0373fac
commit cf0fbcd0ee
+2 -5
View File
@@ -1417,13 +1417,10 @@ mrb_mod_alias(mrb_state *mrb, mrb_value mod)
static void
undef_method(mrb_state *mrb, struct RClass *c, mrb_sym a)
{
mrb_value m, val;
mrb_value m;
if (!mrb_obj_respond_to(c, a)) {
val = mrb_iv_remove(mrb, mrb_obj_value(c), a);
if (mrb_undef_p(val)) {
mrb_name_error(mrb, a, "undefined method '%S' for class '%S'", mrb_sym2str(mrb, a), mrb_obj_value(c));
}
mrb_name_error(mrb, a, "undefined method '%S' for class '%S'", mrb_sym2str(mrb, a), mrb_obj_value(c));
} else {
MRB_SET_VALUE(m, MRB_TT_PROC, value.p, 0);
mrb_define_method_vm(mrb, c, a, m);