aboutsummaryrefslogtreecommitdiffstats
path: root/vm_method.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/vm_method.c b/vm_method.c
index 927bbc10f1..d7d18cf4fa 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -1259,8 +1259,15 @@ obj_respond_to(int argc, VALUE *argv, VALUE obj)
ID id;
rb_scan_args(argc, argv, "11", &mid, &priv);
- if (!(id = rb_check_id(&mid)))
+ if (!(id = rb_check_id(&mid))) {
+ if (!rb_method_basic_definition_p(CLASS_OF(obj), respond_to_missing)) {
+ VALUE args[2];
+ args[0] = ID2SYM(rb_to_id(mid));
+ args[1] = priv;
+ return rb_funcall2(obj, respond_to_missing, 2, args);
+ }
return Qfalse;
+ }
if (basic_obj_respond_to(obj, id, !RTEST(priv)))
return Qtrue;
return Qfalse;