diff options
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | test/ruby/test_module.rb | 2 | ||||
| -rw-r--r-- | variable.c | 4 | ||||
| -rw-r--r-- | version.h | 2 |
4 files changed, 11 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Tue Jun 14 03:34:27 2016 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * variable.c (rb_local_constants_i): exclude hidden constants. + [ruby-core:75575] [Bug #12389] + Tue Jun 14 03:25:14 2016 Benoit Daloze <eregontp@gmail.com> * insns.def (defineclass): Also raise an error when redeclaring the diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 55678e42a8..e13f7e9110 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -603,6 +603,8 @@ class TestModule < Test::Unit::TestCase const_set(:X, 123) end assert_equal(false, klass.class_eval { Module.constants }.include?(:X)) + + assert_equal(false, Complex.constants(false).include?(:compatible)) end module M1 diff --git a/variable.c b/variable.c index 79e4c8d530..1f8506e784 100644 --- a/variable.c +++ b/variable.c @@ -2370,7 +2370,9 @@ sv_i(st_data_t k, st_data_t v, st_data_t a) static int rb_local_constants_i(st_data_t const_name, st_data_t const_value, st_data_t ary) { - rb_ary_push((VALUE)ary, ID2SYM((ID)const_name)); + if (rb_is_const_id(const_name)) { + rb_ary_push((VALUE)ary, ID2SYM((ID)const_name)); + } return ST_CONTINUE; } @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.3.2" #define RUBY_RELEASE_DATE "2016-06-14" -#define RUBY_PATCHLEVEL 127 +#define RUBY_PATCHLEVEL 128 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 6 |
