ruby-changes:44235
From: usa <ko1@a...>
Date: Sat, 1 Oct 2016 01:05:49 +0900 (JST)
Subject: [ruby-changes:44235] usa:r56309 (ruby_2_2): merge revision(s) 56117: [Backport #12742]
usa 2016-10-01 01:05:44 +0900 (Sat, 01 Oct 2016) New Revision: 56309 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56309 Log: merge revision(s) 56117: [Backport #12742] * variable.c (rb_const_search): raise with the actual class/module name which defines the private constant. Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/test/ruby/test_module.rb branches/ruby_2_2/variable.c branches/ruby_2_2/version.h Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 56308) +++ ruby_2_2/version.h (revision 56309) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.6" #define RUBY_RELEASE_DATE "2016-10-01" -#define RUBY_PATCHLEVEL 378 +#define RUBY_PATCHLEVEL 379 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 10 Index: ruby_2_2/test/ruby/test_module.rb =================================================================== --- ruby_2_2/test/ruby/test_module.rb (revision 56308) +++ ruby_2_2/test/ruby/test_module.rb (revision 56309) @@ -1306,6 +1306,9 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_module.rb#L1306 c.const_set(:FOO, "foo") $VERBOSE = verbose assert_raise(NameError) { c::FOO } + assert_raise_with_message(NameError, /#{c}::FOO/) do + Class.new(c)::FOO + end end def test_private_constant2 Index: ruby_2_2/variable.c =================================================================== --- ruby_2_2/variable.c (revision 56308) +++ ruby_2_2/variable.c (revision 56309) @@ -1852,7 +1852,7 @@ rb_const_get_0(VALUE klass, ID id, int e https://github.com/ruby/ruby/blob/trunk/ruby_2_2/variable.c#L1852 while ((ce = rb_const_lookup(tmp, id))) { if (visibility && RB_CONST_PRIVATE_P(ce)) { rb_name_error(id, "private constant %"PRIsVALUE"::%"PRIsVALUE" referenced", - rb_class_name(klass), QUOTE_ID(id)); + rb_class_name(tmp), QUOTE_ID(id)); } value = ce->value; if (value == Qundef) { Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 56308) +++ ruby_2_2/ChangeLog (revision 56309) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Sat Oct 1 01:02:22 2016 Nobuyoshi Nakada <nobu@r...> + + * variable.c (rb_const_search): raise with the actual class/module + name which defines the private constant. + Sat Oct 1 00:57:54 2016 NARUSE, Yui <naruse@r...> * vm_dump.c (backtrace): use rip in the saved context for the case Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r56117 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/