summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-10 18:12:08 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-10 18:12:08 +0000
commit84a867fae8ef7bb0947e3809b190f1e36ca8fe80 (patch)
tree91d4346c43321dd4c145aab22f49b5bea01cf935 /vm_method.c
parentca42d13e850de4e2c5c1864feae6dcc534e4ca16 (diff)
merge revision(s) 33935,33936,33987:
* variable.c (set_const_visibility): Module#private_constant has changed the visibility of only the first argument. Now it changes all of them. [ruby-list:48558] * test/ruby/test_module.rb: add a test for above. * variable.c (set_const_visibility): print a warning when no argument is passwd to Module#private_constant. [ruby-list:48558] * vm_method.c (set_method_visibility): ditto for Module#private_class_method. * variable.c (set_const_visibility): clear inine-cache when constant's visibility is modified. [ruby-dev:44929] * test/ruby/test_module.rb (test_private_constants_clear_inlinecache): add test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vm_method.c b/vm_method.c
index 239b3887cb..086046aa0b 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -961,6 +961,11 @@ set_method_visibility(VALUE self, int argc, VALUE *argv, rb_method_flag_t ex)
{
int i;
secure_visibility(self);
+
+ if (argc == 0) {
+ rb_warning("%s with no argument is just ignored", rb_id2name(rb_frame_callee()));
+ }
+
for (i = 0; i < argc; i++) {
rb_export_method(self, rb_to_id(argv[i]), ex);
}