[前][次][番号順一覧][スレッド一覧]

ruby-changes:13599

From: matz <ko1@a...>
Date: Sat, 17 Oct 2009 14:37:13 +0900 (JST)
Subject: [ruby-changes:13599] Ruby:r25381 (trunk): * vm_method.c (basic_obj_respond_to): call #respond_to_missing?

matz	2009-10-17 14:34:51 +0900 (Sat, 17 Oct 2009)

  New Revision: 25381

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25381

  Log:
    * vm_method.c (basic_obj_respond_to): call #respond_to_missing?
      always with two arguments.  [ruby-core:26090]

  Modified files:
    trunk/ChangeLog
    trunk/lib/delegate.rb
    trunk/vm_method.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 25380)
+++ ChangeLog	(revision 25381)
@@ -1,3 +1,8 @@
+Sat Oct 17 11:27:44 2009  Yukihiro Matsumoto  <matz@r...>
+
+	* vm_method.c (basic_obj_respond_to): call #respond_to_missing?
+	  always with two arguments.  [ruby-core:26090]
+
 Sat Oct 17 08:51:44 2009  Yukihiro Matsumoto  <matz@r...>
 
 	* lib/delegate.rb (Delegator#respond_to_missing): warn only when
Index: lib/delegate.rb
===================================================================
--- lib/delegate.rb	(revision 25380)
+++ lib/delegate.rb	(revision 25381)
@@ -148,7 +148,7 @@
   # Checks for a method provided by this the delegate object by forwarding the
   # call through \_\_getobj\_\_.
   #
-  def respond_to_missing?(m, include_private = false)
+  def respond_to_missing?(m, include_private)
     r = self.__getobj__.respond_to?(m, include_private)
     if r && include_private && !self.__getobj__.respond_to?(m, false)
       warn "#{caller(3)[0]}: delegator does not forward private method \##{m}"
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 25380)
+++ vm_method.c	(revision 25381)
@@ -1157,7 +1157,7 @@
       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 @@
 
 /*
  *  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 @@
  *  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 @@
 #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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]