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

ruby-changes:26611

From: nobu <ko1@a...>
Date: Sun, 30 Dec 2012 23:01:46 +0900 (JST)
Subject: [ruby-changes:26611] nobu:r38662 (trunk): vm_method.c: idRespond_to_missing

nobu	2012-12-30 23:01:37 +0900 (Sun, 30 Dec 2012)

  New Revision: 38662

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

  Log:
    vm_method.c: idRespond_to_missing
    
    * vm_method.c (respond_to_missing): use idRespond_to_missing.

  Modified files:
    trunk/vm_method.c

Index: vm_method.c
===================================================================
--- vm_method.c	(revision 38661)
+++ vm_method.c	(revision 38662)
@@ -13,7 +13,7 @@ https://github.com/ruby/ruby/blob/trunk/vm_method.c#L13
 
 static void rb_vm_check_redefinition_opt_method(const rb_method_entry_t *me, VALUE klass);
 
-static ID object_id, respond_to_missing;
+static ID object_id;
 static ID removed, singleton_removed, undefined, singleton_undefined;
 static ID added, singleton_added, attached;
 
@@ -1506,7 +1506,7 @@ basic_obj_respond_to(VALUE obj, ID id, i https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1506
       case 0:
 	args[0] = ID2SYM(id);
 	args[1] = pub ? Qfalse : Qtrue;
-	return RTEST(rb_funcall2(obj, respond_to_missing, 2, args));
+	return RTEST(rb_funcall2(obj, idRespond_to_missing, 2, args));
       default:
 	return TRUE;
     }
@@ -1556,11 +1556,11 @@ obj_respond_to(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1556
 
     rb_scan_args(argc, argv, "11", &mid, &priv);
     if (!(id = rb_check_id(&mid))) {
-	if (!rb_method_basic_definition_p(CLASS_OF(obj), respond_to_missing)) {
+	if (!rb_method_basic_definition_p(CLASS_OF(obj), idRespond_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 rb_funcall2(obj, idRespond_to_missing, 2, args);
 	}
 	return Qfalse;
     }
@@ -1621,7 +1621,6 @@ Init_eval_method(void) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1621
     undefined = rb_intern("method_undefined");
     singleton_undefined = rb_intern("singleton_method_undefined");
     attached = rb_intern("__attached__");
-    respond_to_missing = rb_intern("respond_to_missing?");
 
     {
 #define REPLICATE_METHOD(klass, id, noex) \
@@ -1630,6 +1629,6 @@ Init_eval_method(void) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1629
 			    (rb_method_flag_t)(noex | NOEX_BASIC | NOEX_NOREDEF))
 	REPLICATE_METHOD(rb_eException, idMethodMissing, NOEX_PRIVATE);
 	REPLICATE_METHOD(rb_eException, idRespond_to, NOEX_PUBLIC);
-	REPLICATE_METHOD(rb_eException, respond_to_missing, NOEX_PUBLIC);
+	REPLICATE_METHOD(rb_eException, idRespond_to_missing, NOEX_PUBLIC);
     }
 }

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

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