mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
merge revision(s) 40346: [Backport #8284]
* vm_method.c (rb_mod_public_method): fix visibility on anonymous module. set visibility of singleton method, not method in base class. [ruby-core:54404] [Bug #8284] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
96de351eed
commit
c967493b65
4 changed files with 16 additions and 3 deletions
|
@ -1359,7 +1359,7 @@ rb_mod_private(int argc, VALUE *argv, VALUE module)
|
|||
static VALUE
|
||||
rb_mod_public_method(int argc, VALUE *argv, VALUE obj)
|
||||
{
|
||||
set_method_visibility(CLASS_OF(obj), argc, argv, NOEX_PUBLIC);
|
||||
set_method_visibility(rb_singleton_class(obj), argc, argv, NOEX_PUBLIC);
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
@ -1382,7 +1382,7 @@ rb_mod_public_method(int argc, VALUE *argv, VALUE obj)
|
|||
static VALUE
|
||||
rb_mod_private_method(int argc, VALUE *argv, VALUE obj)
|
||||
{
|
||||
set_method_visibility(CLASS_OF(obj), argc, argv, NOEX_PRIVATE);
|
||||
set_method_visibility(rb_singleton_class(obj), argc, argv, NOEX_PRIVATE);
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue