mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* proc.c (method_eq): fix the documentation to refer to owner.
[ruby-core:51105] [Bug #7613] * test/ruby/test_method.rb (test_alias_onwer): new test to confirm that `a == b' returns false if owners of a and b are different. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bab92f0fea
commit
d5a39c0aa8
3 changed files with 25 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
Fri Dec 28 11:17:47 2012 Shugo Maeda <shugo@ruby-lang.org>
|
||||
|
||||
* proc.c (method_eq): fix the documentation to refer to owner.
|
||||
[ruby-core:51105] [Bug #7613]
|
||||
|
||||
* test/ruby/test_method.rb (test_alias_onwer): new test to confirm
|
||||
that `a == b' returns false if owners of a and b are different.
|
||||
|
||||
Fri Dec 28 07:07:43 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* def/id.def: use split(/^/) instead of String#lines to support
|
||||
|
|
3
proc.c
3
proc.c
|
@ -1023,7 +1023,8 @@ mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope)
|
|||
* meth == other_meth -> true or false
|
||||
*
|
||||
* Two method objects are equal if they are bound to the same
|
||||
* object and refer to the same method definition.
|
||||
* object and refer to the same method definition and their owners are the
|
||||
* same class or module.
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
|
|
|
@ -507,4 +507,19 @@ class TestMethod < Test::Unit::TestCase
|
|||
assert_instance_of String, __dir__
|
||||
assert_equal(File.dirname(__FILE__), __dir__)
|
||||
end
|
||||
|
||||
def test_alias_owner
|
||||
bug7613 = '[ruby-core:51105]'
|
||||
c = Class.new {
|
||||
def foo
|
||||
end
|
||||
}
|
||||
x = c.new
|
||||
class << x
|
||||
alias bar foo
|
||||
end
|
||||
assert_equal(c, x.method(:foo).owner)
|
||||
assert_equal(x.singleton_class, x.method(:bar).owner)
|
||||
assert(x.method(:foo) != x.method(:bar), bug7613)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue