From 205b5c9cd64a5a0d5f104159e919e82a03b10cb4 Mon Sep 17 00:00:00 2001 From: nagachika Date: Tue, 4 Jun 2013 14:34:56 +0000 Subject: merge revision(s) 40915: [Backport #8448] * 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ test/ruby/test_module.rb | 9 +++++++++ variable.c | 2 +- version.h | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 37fa3d7771..58eb29225f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Jun 4 23:32:12 2013 Charlie Somerville + + * 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 * 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++) { diff --git a/version.h b/version.h index 8ea58eae91..a829513073 100644 --- a/version.h +++ b/version.h @@ -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 -- cgit v1.2.3