ruby-changes:21887
From: mame <ko1@a...>
Date: Sat, 3 Dec 2011 20:52:27 +0900 (JST)
Subject: [ruby-changes:21887] mame:r33936 (trunk): * variable.c (set_const_visibility): print a warning when no argument
mame 2011-12-03 20:52:14 +0900 (Sat, 03 Dec 2011) New Revision: 33936 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33936 Log: * 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. Modified files: trunk/ChangeLog trunk/variable.c trunk/vm_method.c Index: ChangeLog =================================================================== --- ChangeLog (revision 33935) +++ ChangeLog (revision 33936) @@ -1,3 +1,11 @@ +Sat Dec 3 20:49:16 2011 Yusuke Endoh <mame@t...> + + * 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. + Sat Dec 3 20:43:14 2011 Yusuke Endoh <mame@t...> * variable.c (set_const_visibility): Module#private_constant has Index: variable.c =================================================================== --- variable.c (revision 33935) +++ variable.c (revision 33936) @@ -2111,6 +2111,10 @@ "Insecure: can't change constant visibility"); } + if (argc == 0) { + rb_warning("%s with no argument is just ignored", rb_id2name(rb_frame_callee())); + } + for (i = 0; i < argc; i++) { VALUE val = argv[i]; id = rb_check_id(&val); Index: vm_method.c =================================================================== --- vm_method.c (revision 33935) +++ vm_method.c (revision 33936) @@ -985,6 +985,11 @@ { 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++) { VALUE v = argv[i]; ID id = rb_check_id(&v); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/