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
This commit is contained in:
nagachika 2013-06-04 14:34:56 +00:00
parent 2392c12bd1
commit 205b5c9cd6
4 changed files with 18 additions and 2 deletions

View file

@ -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,

View file

@ -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

View file

@ -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++) {

View file

@ -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