diff options
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | NEWS | 2 | ||||
| -rw-r--r-- | eval.c | 2 | ||||
| -rw-r--r-- | test/ruby/test_method.rb | 2 |
4 files changed, 11 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Sun May 11 10:36:10 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com> + + * eval.c (method_name, method_owner): New methods; backported + from 1.9. (UnboundMethod#name, UnboundMethod#owner) + Sun May 11 02:48:13 2008 <nagai@orca16.orcabay.ddo.jp> * ext/tk/lib/tk/pack.rb, ext/tk/lib/tk/grid.rb: fail to do pack/grid @@ -187,6 +187,8 @@ with all sufficient information, see the ChangeLog file. * Method#receiver * Method#name * Method#owner + * UnboundMethod#name + * UnboundMethod#owner New methods. @@ -9940,6 +9940,8 @@ Init_Proc() rb_define_method(rb_cUnboundMethod, "arity", method_arity, 0); rb_define_method(rb_cUnboundMethod, "inspect", method_inspect, 0); rb_define_method(rb_cUnboundMethod, "to_s", method_inspect, 0); + rb_define_method(rb_cUnboundMethod, "name", method_name, 0); + rb_define_method(rb_cUnboundMethod, "owner", method_owner, 0); rb_define_method(rb_cUnboundMethod, "bind", umethod_bind, 1); rb_define_method(rb_cModule, "instance_method", rb_mod_method, 1); } diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index b22c2cba62..d721176aa0 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -47,5 +47,7 @@ class TestMethod < Test::Unit::TestCase assert_equal(o, m.receiver) assert_equal("foo", m.name) assert_equal(class << o; self; end, m.owner) + assert_equal("foo", m.unbind.name) + assert_equal(class << o; self; end, m.unbind.owner) end end |
