variable.c: top-level constant look-up

* variable.c (rb_const_search): [EXPERIMENTAL] remove top-level
  constant look-up.  [Feature #11547]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-01-01 09:07:56 +00:00
Родитель 46454b5ee6
Коммит 44a2576f79
2 изменённых файлов: 6 добавлений и 0 удалений

2
NEWS
Просмотреть файл

@ -14,6 +14,8 @@ with all sufficient information, see the ChangeLog file or Redmine
=== Language changes
* Top-level constant look-up is removed. [Feature #11547]
=== Core classes updates (outstanding ones only)
=== Stdlib updates (outstanding ones only)

Просмотреть файл

@ -2273,8 +2273,12 @@ rb_const_search(VALUE klass, ID id, int exclude, int recurse, int visibility)
continue;
}
if (exclude && tmp == rb_cObject && klass != rb_cObject) {
#if 0
rb_warn("toplevel constant %"PRIsVALUE" referenced by %"PRIsVALUE"::%"PRIsVALUE"",
QUOTE_ID(id), rb_class_name(klass), QUOTE_ID(id));
#else
return Qundef;
#endif
}
return value;
}