summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-07-17 16:24:16 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2012-07-17 16:24:16 -0700
commit4df4a3f0bf6e047daa83779730eb208e1a4f78c9 (patch)
tree33d8086317aae816d207076e007ffdaf72a2b741 /src
parent1f7003c467232670e785a45adb5ac11db60049df (diff)
parent6f2aefae1f6032be5c7a7ba82734543b90be5ccc (diff)
downloadmruby-4df4a3f0bf6e047daa83779730eb208e1a4f78c9.tar.gz
mruby-4df4a3f0bf6e047daa83779730eb208e1a4f78c9.zip
Merge pull request #380 from masamitsu-murase/modify_respond_to
Modify return value of 'respond_to?'
Diffstat (limited to 'src')
-rw-r--r--src/class.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/class.c b/src/class.c
index 027eceb10..7f53b7a2b 100644
--- a/src/class.c
+++ b/src/class.c
@@ -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;
}