ruby-changes:18508
From: ryan <ko1@a...>
Date: Thu, 13 Jan 2011 07:06:11 +0900 (JST)
Subject: [ruby-changes:18508] Ruby:r30531 (trunk): Exception#to_s should actually call to_s.
ryan 2011-01-13 07:05:05 +0900 (Thu, 13 Jan 2011) New Revision: 30531 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30531 Log: Exception#to_s should actually call to_s. Modified files: trunk/ChangeLog trunk/error.c Index: ChangeLog =================================================================== --- ChangeLog (revision 30530) +++ ChangeLog (revision 30531) @@ -1,3 +1,7 @@ +Thu Jan 13 06:27:29 2011 Ryan Davis <ryand-ruby@z...> + + * error.c: Exception#to_s should actually call to_s. + Thu Jan 13 00:32:54 2011 NARUSE, Yui <naruse@r...> * addr2line.c (get_nth_dirname): decrement the directory index Index: error.c =================================================================== --- error.c (revision 30530) +++ error.c (revision 30531) @@ -522,9 +522,12 @@ 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; } /* -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/