Kernel#respond_to? should return false if the method is undefined.

This commit is contained in:
Masamitsu MURASE
2012-07-18 02:17:29 +09:00
parent a18699a80c
commit a0c4f8558b
+8 -2
View File
@@ -1052,8 +1052,14 @@ mrb_obj_respond_to(struct RClass* c, mrb_sym mid)
if (h) {
k = kh_get(mt, h, mid);
if (k != kh_end(h))
return 1; /* exist method */
if (k != kh_end(h)) {
if (kh_value(h, k)) {
return 1; /* exist method */
}
else {
return 0;
}
}
}
c = c->super;
}