From 988552998662dedde9e5175f733dd31f0332abf7 Mon Sep 17 00:00:00 2001 From: charliesome Date: Fri, 24 May 2013 10:33:05 +0000 Subject: * 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ test/ruby/test_module.rb | 9 +++++++++ variable.c | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 77fe435735..810d7ffadd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri May 24 19:32:00 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 + Fri May 24 18:53:10 2013 Koichi Sasada * gc.c: do major/full GC when: diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 75a7b52ca8..fa7a408ede 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1232,6 +1232,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 5f06a9d5ae..679dfac693 100644 --- a/variable.c +++ b/variable.c @@ -2231,7 +2231,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++) { -- cgit v1.2.3