diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-23 13:57:30 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-23 13:57:30 +0000 |
commit | aadf98f11f6d8c429f91c5ddebdc4dfadeed9395 (patch) | |
tree | 8d59da3cf6b9dbd2412440aaecbac7eab9045ac9 | |
parent | f0f3821be7507a96e613e6d8e7e675eada78a892 (diff) |
merge revision(s) 44198: [Backport #9236]
* proc.c (mnew_from_me): method by respond_to_missing? should be
owned by the original class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@44366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | proc.c | 1 | ||||
-rw-r--r-- | test/ruby/test_method.rb | 11 | ||||
-rw-r--r-- | version.h | 6 |
4 files changed, 20 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Mon Dec 23 22:37:01 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * proc.c (mnew_from_me): method by respond_to_missing? should be + owned by the original class. + Sun Dec 22 22:56:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> * proc.c (mnew_from_me): achieve the original defined_class from @@ -955,6 +955,7 @@ mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope) def->type = VM_METHOD_TYPE_MISSING; def->original_id = id; def->alias_count = 0; + defined_class = klass; meb.flag = 0; meb.mark = 0; diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index 1514c26f5c..f44f7e5bdb 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -189,6 +189,17 @@ class TestMethod < Test::Unit::TestCase assert_equal(c, c2.instance_method(:foo).owner) end + def test_owner_missing + c = Class.new do + def respond_to_missing?(name, bool) + name == :foo + end + end + c2 = Class.new(c) + assert_equal(c, c.new.method(:foo).owner) + assert_equal(c2, c2.new.method(:foo).owner) + end + def test_receiver_name_owner o = Object.new def o.foo; end @@ -1,10 +1,10 @@ #define RUBY_VERSION "2.0.0" -#define RUBY_RELEASE_DATE "2013-12-22" -#define RUBY_PATCHLEVEL 371 +#define RUBY_RELEASE_DATE "2013-12-23" +#define RUBY_PATCHLEVEL 372 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 12 -#define RUBY_RELEASE_DAY 22 +#define RUBY_RELEASE_DAY 23 #include "ruby/version.h" |