mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (Init_eval): move instance_eval and instance_exec to
BasicObject. [ruby-core:14747] * lib/delegate.rb: should preserve new methods in BasicObject. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b65d6208fe
commit
373d43f61e
3 changed files with 13 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
|||
Sat Jan 5 01:50:32 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* 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@ruby-lang.org>
|
||||
|
||||
* ruby.c (proc_options): update according to the last API revert.
|
||||
|
|
4
eval.c
4
eval.c
|
@ -2726,8 +2726,8 @@ Init_eval(void)
|
|||
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);
|
||||
|
|
|
@ -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 @@ def DelegateClass(superclass)
|
|||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue