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

ruby-changes:3393

From: ko1@a...
Date: 5 Jan 2008 01:52:49 +0900
Subject: [ruby-changes:3393] matz - Ruby:r14886 (trunk): * eval.c (Init_eval): move instance_eval and instance_exec to

matz	2008-01-05 01:51:16 +0900 (Sat, 05 Jan 2008)

  New Revision: 14886

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

  Log:
    * eval.c (Init_eval): move instance_eval and instance_exec to
      BasicObject.  [ruby-core:14747]
    
    * lib/delegate.rb: should preserve new methods in BasicObject.

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/delegate.rb?r1=14886&r2=14885&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14886&r2=14885&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/eval.c?r1=14886&r2=14885&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14885)
+++ ChangeLog	(revision 14886)
@@ -1,3 +1,10 @@
+Sat Jan  5 01:50:32 2008  Yukihiro Matsumoto  <matz@r...>
+
+	* eval.c (Init_eval): move instance_eval and instance_exec to
+	  BasicObject.  [ruby-core:14747]
+
+	* lib/delegate.rb: should preserve new methods in BasicObject.
+
 Sat Jan  5 01:46:29 2008  Yukihiro Matsumoto  <matz@r...>
 
 	* ruby.c (proc_options): update according to the last API revert.
Index: lib/delegate.rb
===================================================================
--- lib/delegate.rb	(revision 14885)
+++ lib/delegate.rb	(revision 14886)
@@ -115,7 +115,9 @@
 # implementation, see SimpleDelegator.
 #
 class Delegator
-  preserved = [:__id__, :object_id, :__send__, :public_send, :respond_to?, :send]
+  preserved = [:__id__, :object_id, :__send__, :public_send, :respond_to?, :send,
+               :instance_eval, :instance_exec,
+              ]
   instance_methods.each do |m|
     next if preserved.include?(m)
     undef_method m
@@ -264,7 +266,7 @@
   methods -= [
     :__id__, :object_id, :__send__, :public_send, :respond_to?, :send,
     :==, :equal?, :initialize, :method_missing, :__getobj__, :__setobj__,
-    :clone, :dup, :marshal_dump, :marshal_load,
+    :clone, :dup, :marshal_dump, :marshal_load, :instance_eval, :instance_exec,
   ]
   klass.module_eval {
     include Delegator::MethodDelegation
Index: eval.c
===================================================================
--- eval.c	(revision 14885)
+++ eval.c	(revision 14886)
@@ -2726,8 +2726,8 @@
     rb_define_method(rb_mKernel, "send", rb_f_send, -1);
     rb_define_method(rb_mKernel, "public_send", rb_f_public_send, -1);
 
-    rb_define_method(rb_mKernel, "instance_eval", rb_obj_instance_eval, -1);
-    rb_define_method(rb_mKernel, "instance_exec", rb_obj_instance_exec, -1);
+    rb_define_method(rb_cBasicObject, "instance_eval", rb_obj_instance_eval, -1);
+    rb_define_method(rb_cBasicObject, "instance_exec", rb_obj_instance_exec, -1);
 
     rb_define_private_method(rb_cModule, "append_features", rb_mod_append_features, 1);
     rb_define_private_method(rb_cModule, "extend_object", rb_mod_extend_object, 1);

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

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