From eccb700286af9428a402dc9fd0139e75d36c31f0 Mon Sep 17 00:00:00 2001 From: matz Date: Sat, 17 Oct 2009 05:34:51 +0000 Subject: * vm_method.c (basic_obj_respond_to): call #respond_to_missing? always with two arguments. [ruby-core:26090] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_method.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vm_method.c') diff --git a/vm_method.c b/vm_method.c index bed8e61bd6..557583f5aa 100644 --- a/vm_method.c +++ b/vm_method.c @@ -1157,7 +1157,7 @@ basic_obj_respond_to(VALUE obj, ID id, int pub) case 2: return FALSE; case 0: - return RTEST(rb_funcall(obj, respond_to_missing, pub ? 1 : 2, ID2SYM(id), Qtrue)); + return RTEST(rb_funcall(obj, respond_to_missing, 2, ID2SYM(id), pub ? Qfalse : Qtrue)); default: return TRUE; } @@ -1214,7 +1214,7 @@ obj_respond_to(int argc, VALUE *argv, VALUE obj) /* * call-seq: - * obj.respond_to_missing?(symbol, include_private=false) => true or false + * obj.respond_to_missing?(symbol, include_private) => true or false * * Hook method to return whether the _obj_ can respond to _id_ method * or not. @@ -1222,7 +1222,7 @@ obj_respond_to(int argc, VALUE *argv, VALUE obj) * See #respond_to?. */ static VALUE -obj_respond_to_missing(int argc, VALUE *argv, VALUE obj) +obj_respond_to_missing(VALUE obj, VALUE priv) { return Qfalse; } @@ -1234,7 +1234,7 @@ Init_eval_method(void) #define rb_intern(str) rb_intern_const(str) rb_define_method(rb_mKernel, "respond_to?", obj_respond_to, -1); - rb_define_method(rb_mKernel, "respond_to_missing?", obj_respond_to_missing, -1); + rb_define_method(rb_mKernel, "respond_to_missing?", obj_respond_to_missing, 2); rb_define_private_method(rb_cModule, "remove_method", rb_mod_remove_method, -1); rb_define_private_method(rb_cModule, "undef_method", rb_mod_undef_method, -1); -- cgit v1.2.3