summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-27 08:38:50 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-27 08:38:50 (GMT)
commitc57c719e4ab00e4b7a9fc8af21b4140945167554 (patch)
tree890d1d82387ccb44bb6ac69411d97ba100590bcd /variable.c
parent4fad63da01789ad3b562833c97d289d2abfeff19 (diff)
variable.c: hidden constants
* variable.c (rb_local_constants_i): exclude hidden constants. [ruby-core:75575] [Bug #12389] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/variable.c b/variable.c
index db26268..849be3a 100644
--- a/variable.c
+++ b/variable.c
@@ -2388,7 +2388,9 @@ sv_i(ID key, VALUE v, void *a)
static enum rb_id_table_iterator_result
rb_local_constants_i(ID const_name, VALUE const_value, void *ary)
{
- rb_ary_push((VALUE)ary, ID2SYM(const_name));
+ if (rb_is_const_id(const_name)) {
+ rb_ary_push((VALUE)ary, ID2SYM(const_name));
+ }
return ID_TABLE_CONTINUE;
}