summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--NEWS2
-rw-r--r--eval.c2
-rw-r--r--test/ruby/test_method.rb2
4 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d3cb1c858..aa75b5a5b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/NEWS b/NEWS
index 6e3de72a37..a75cde9aa3 100644
--- a/NEWS
+++ b/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.
diff --git a/eval.c b/eval.c
index 41ffba6ecd..75e85bf494 100644
--- a/eval.c
+++ b/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);
}
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