зеркало из https://github.com/github/ruby.git
Exception#to_s should actually call to_s.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
b404cbac77
Коммит
36a0e432f2
|
@ -1,3 +1,7 @@
|
|||
Thu Jan 13 06:27:29 2011 Ryan Davis <ryand-ruby@zenspider.com>
|
||||
|
||||
* error.c: Exception#to_s should actually call to_s.
|
||||
|
||||
Thu Jan 13 00:32:54 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* addr2line.c (get_nth_dirname): decrement the directory index
|
||||
|
|
5
error.c
5
error.c
|
@ -522,9 +522,12 @@ static VALUE
|
|||
exc_to_s(VALUE exc)
|
||||
{
|
||||
VALUE mesg = rb_attr_get(exc, rb_intern("mesg"));
|
||||
VALUE r = Qnil;
|
||||
|
||||
if (NIL_P(mesg)) return rb_class_name(CLASS_OF(exc));
|
||||
return rb_String(mesg);
|
||||
r = rb_String(mesg);
|
||||
OBJ_INFECT(r, exc);
|
||||
return r;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче