зеркало из https://github.com/github/ruby.git
object.c: fix error message
* object.c (rb_mod_const_get): make error message at uninterned string consistent with symbols. [ruby-dev:49498] [Bug #12089] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
3ad8210ce1
Коммит
8790fdce57
|
@ -1,3 +1,8 @@
|
|||
Sat Feb 20 01:53:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* object.c (rb_mod_const_get): make error message at uninterned
|
||||
string consistent with symbols. [ruby-dev:49498] [Bug #12089]
|
||||
|
||||
Fri Feb 19 23:37:52 2016 Masahiro Tomita <tommy@tmtm.org>
|
||||
|
||||
* lib/find.rb (Find#find): raise with the given path name if it
|
||||
|
|
2
object.c
2
object.c
|
@ -2139,7 +2139,7 @@ rb_mod_const_get(int argc, VALUE *argv, VALUE mod)
|
|||
continue;
|
||||
}
|
||||
else {
|
||||
rb_name_err_raise("uninitialized constant %2$s::%1$s", mod, part);
|
||||
rb_mod_const_missing(mod, part);
|
||||
}
|
||||
}
|
||||
if (!rb_is_const_id(id)) {
|
||||
|
|
|
@ -54,6 +54,14 @@ module Test_Symbol
|
|||
assert_not_interned_error(cl, :const_get, name.to_sym)
|
||||
end
|
||||
|
||||
def test_module_const_get_toplevel
|
||||
bug12089 = '[ruby-dev:49498] [Bug #12089]'
|
||||
name = noninterned_name("A")
|
||||
e = assert_not_interned_error(Object, :const_get, name)
|
||||
assert_equal(name, e.name)
|
||||
assert_not_match(/Object::/, e.message, bug12089)
|
||||
end
|
||||
|
||||
def test_module_const_defined?
|
||||
cl = Class.new
|
||||
name = noninterned_name("A")
|
||||
|
|
Загрузка…
Ссылка в новой задаче