mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (method_name, method_owner): New methods; backported from 1.9. (UnboundMethod#name, UnboundMethod#owner)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f648718073
commit
5fed7fa349
4 changed files with 11 additions and 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
|
||||
|
|
2
NEWS
2
NEWS
|
@ -187,6 +187,8 @@ with all sufficient information, see the ChangeLog file.
|
|||
* Method#receiver
|
||||
* Method#name
|
||||
* Method#owner
|
||||
* UnboundMethod#name
|
||||
* UnboundMethod#owner
|
||||
|
||||
New methods.
|
||||
|
||||
|
|
2
eval.c
2
eval.c
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue