[前][次][番号順一覧][スレッド一覧]

ruby-changes:43795

From: nagachika <ko1@a...>
Date: Fri, 12 Aug 2016 03:39:10 +0900 (JST)
Subject: [ruby-changes:43795] nagachika:r55868 (ruby_2_3): merge revision(s) 55705: [Backport #12345]

nagachika	2016-08-12 03:39:06 +0900 (Fri, 12 Aug 2016)

  New Revision: 55868

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55868

  Log:
    merge revision(s) 55705: [Backport #12345]
    
    * variable.c (rb_local_constants_i): exclude private constants
      when excluding inherited constants too.  [Bug #12345]

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/test/ruby/test_module.rb
    branches/ruby_2_3/variable.c
    branches/ruby_2_3/version.h
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 55867)
+++ ruby_2_3/ChangeLog	(revision 55868)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Fri Aug 12 03:30:59 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* variable.c (rb_local_constants_i): exclude private constants
+	  when excluding inherited constants too.  [Bug #12345]
+
 Fri Aug 12 03:00:05 2016  Masatoshi SEKI  <m_seki@m...>
 
 	* lib/drb/timeridconv.rb: don't use keeper thread. [Bug #12342]
Index: ruby_2_3/variable.c
===================================================================
--- ruby_2_3/variable.c	(revision 55867)
+++ ruby_2_3/variable.c	(revision 55868)
@@ -2376,7 +2376,7 @@ sv_i(st_data_t k, st_data_t v, st_data_t https://github.com/ruby/ruby/blob/trunk/ruby_2_3/variable.c#L2376
 static int
 rb_local_constants_i(st_data_t const_name, st_data_t const_value, st_data_t ary)
 {
-    if (rb_is_const_id(const_name)) {
+    if (rb_is_const_id(const_name) && !RB_CONST_PRIVATE_P((rb_const_entry_t *)const_value)) {
 	rb_ary_push((VALUE)ary, ID2SYM((ID)const_name));
     }
     return ST_CONTINUE;
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 55867)
+++ ruby_2_3/version.h	(revision 55868)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.2"
 #define RUBY_RELEASE_DATE "2016-08-12"
-#define RUBY_PATCHLEVEL 148
+#define RUBY_PATCHLEVEL 149
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 8
Index: ruby_2_3/test/ruby/test_module.rb
===================================================================
--- ruby_2_3/test/ruby/test_module.rb	(revision 55867)
+++ ruby_2_3/test/ruby/test_module.rb	(revision 55868)
@@ -1425,6 +1425,8 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ruby/test_module.rb#L1425
 
   def test_constants_with_private_constant
     assert_not_include(::TestModule.constants, :PrivateClass)
+    assert_not_include(::TestModule.constants(true), :PrivateClass)
+    assert_not_include(::TestModule.constants(false), :PrivateClass)
   end
 
   def test_toplevel_private_constant

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r55705


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]