diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-13 18:46:30 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-13 18:46:30 +0000 |
commit | f8cccade22dfe6380bdc0d5e9543c585941612f2 (patch) | |
tree | 7baa682d2815c41b05f8e70af6b259be1fee90d2 | |
parent | cd1e32f7ff27f86927acad462ac94ef92216acd9 (diff) |
merge revision(s) 55182: [Backport #12389]
* variable.c (rb_local_constants_i): exclude hidden constants.
[ruby-core:75575] [Bug #12389]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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 |