diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | test/ruby/test_module.rb | 9 | ||||
-rw-r--r-- | variable.c | 2 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 18 insertions, 2 deletions
@@ -1,3 +1,10 @@ +Tue Jun 4 23:32:12 2013 Charlie Somerville <charliesome@ruby-lang.org> + + * variable.c (set_const_visibility): use rb_frame_this_func() instead + of rb_frame_callee() for getting the name of the called method + + * test/ruby/test_module.rb: add test for private_constant with no args + Tue Jun 4 23:27:24 2013 Yusuke Endoh <mame@tsg.ne.jp> * vm_insnhelper.c (vm_callee_setup_keyword_arg, diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 7dd5cce90f..0b47367d66 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1192,6 +1192,15 @@ class TestModule < Test::Unit::TestCase assert_equal("bar", c.class_eval("BAR")) end + def test_private_constant_with_no_args + assert_in_out_err([], <<-RUBY, [], ["-:3: warning: private_constant with no argument is just ignored"]) + $-w = true + class X + private_constant + end + RUBY + end + class PrivateClass end private_constant :PrivateClass diff --git a/variable.c b/variable.c index f6bd70a211..1be62dc1db 100644 --- a/variable.c +++ b/variable.c @@ -2227,7 +2227,7 @@ set_const_visibility(VALUE mod, int argc, VALUE *argv, rb_const_flag_t flag) if (argc == 0) { rb_warning("%"PRIsVALUE" with no argument is just ignored", - QUOTE_ID(rb_frame_callee())); + QUOTE_ID(rb_frame_this_func())); } for (i = 0; i < argc; i++) { @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.0.0" #define RUBY_RELEASE_DATE "2013-06-04" -#define RUBY_PATCHLEVEL 202 +#define RUBY_PATCHLEVEL 203 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 6 |