зеркало из https://github.com/github/ruby.git
* proc.c (mnew): fix wrong error message when Kernel#public_method
receives name of private method. [Bug #2425] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
0ffb18de45
Коммит
478c65c468
|
@ -1,3 +1,8 @@
|
|||
Thu Apr 22 23:10:59 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* proc.c (mnew): fix wrong error message when Kernel#public_method
|
||||
receives name of private method. [Bug #2425]
|
||||
|
||||
Thu Apr 22 22:56:42 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* bootstraptest/test_thread.rb: fix test. [Bug #2342]
|
||||
|
|
11
proc.c
11
proc.c
|
@ -925,7 +925,16 @@ mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope)
|
|||
if (flag == NOEX_UNDEF) {
|
||||
flag = me->flag;
|
||||
if (scope && (flag & NOEX_MASK) != NOEX_PUBLIC) {
|
||||
rb_print_undef(rclass, def->original_id, (int)(flag & NOEX_MASK));
|
||||
const char *v = "";
|
||||
switch (flag & NOEX_MASK) {
|
||||
case NOEX_PRIVATE: v = "private"; break;
|
||||
case NOEX_PROTECTED: v = "protected"; break;
|
||||
}
|
||||
rb_name_error(id, "method `%s' for %s `%s' is %s",
|
||||
rb_id2name(id),
|
||||
(TYPE(klass) == T_MODULE) ? "module" : "class",
|
||||
rb_class2name(klass),
|
||||
v);
|
||||
}
|
||||
}
|
||||
if (def && def->type == VM_METHOD_TYPE_ZSUPER) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче