ruby-changes:30660
From: nobu <ko1@a...>
Date: Sat, 31 Aug 2013 13:30:58 +0900 (JST)
Subject: [ruby-changes:30660] nobu:r42739 (trunk): proc.c: preserve encodings
nobu 2013-08-31 13:30:30 +0900 (Sat, 31 Aug 2013) New Revision: 42739 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42739 Log: proc.c: preserve encodings * proc.c (mnew_from_me, rb_mod_define_method, umethod_bind), (method_inspect): preserve class name encodings. Modified files: trunk/proc.c Index: proc.c =================================================================== --- proc.c (revision 42738) +++ proc.c (revision 42739) @@ -1163,10 +1163,10 @@ mnew_from_me(rb_method_entry_t *me, VALU https://github.com/ruby/ruby/blob/trunk/proc.c#L1163 case NOEX_PRIVATE: v = "private"; break; case NOEX_PROTECTED: v = "protected"; break; } - rb_name_error(id, "method `%s' for %s `%s' is %s", + rb_name_error(id, "method `%s' for %s `% "PRIsVALUE"' is %s", rb_id2name(id), (RB_TYPE_P(klass, T_MODULE)) ? "module" : "class", - rb_class2name(klass), + rb_class_name(klass), v); } } @@ -1637,8 +1637,8 @@ rb_mod_define_method(int argc, VALUE *ar https://github.com/ruby/ruby/blob/trunk/proc.c#L1637 } else { rb_raise(rb_eTypeError, - "bind argument must be a subclass of %s", - rb_class2name(rclass)); + "bind argument must be a subclass of % "PRIsVALUE, + rb_class_name(rclass)); } } rb_method_entry_set(mod, id, method->me, noex); @@ -1930,8 +1930,8 @@ umethod_bind(VALUE method, VALUE recv) https://github.com/ruby/ruby/blob/trunk/proc.c#L1930 "singleton method called for a different object"); } else { - rb_raise(rb_eTypeError, "bind argument must be an instance of %s", - rb_class2name(methclass)); + rb_raise(rb_eTypeError, "bind argument must be an instance of % "PRIsVALUE, + rb_class_name(methclass)); } } @@ -2229,10 +2229,10 @@ method_inspect(VALUE method) https://github.com/ruby/ruby/blob/trunk/proc.c#L2229 } } else { - rb_str_buf_cat2(str, rb_class2name(data->rclass)); + rb_str_buf_append(str, rb_class_name(data->rclass)); if (data->rclass != data->me->klass) { rb_str_buf_cat2(str, "("); - rb_str_buf_cat2(str, rb_class2name(data->me->klass)); + rb_str_buf_append(str, rb_class_name(data->me->klass)); rb_str_buf_cat2(str, ")"); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/