ruby-changes:35432
From: nobu <ko1@a...>
Date: Wed, 10 Sep 2014 17:22:18 +0900 (JST)
Subject: [ruby-changes:35432] nobu:r47514 (trunk): gc.c: preserve encoding
nobu 2014-09-10 17:22:03 +0900 (Wed, 10 Sep 2014) New Revision: 47514 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47514 Log: gc.c: preserve encoding * gc.c (should_be_callable): preserve encoding of class name in error messages. Modified files: trunk/gc.c trunk/test/ruby/test_objectspace.rb Index: gc.c =================================================================== --- gc.c (revision 47513) +++ gc.c (revision 47514) @@ -2279,8 +2279,8 @@ static void https://github.com/ruby/ruby/blob/trunk/gc.c#L2279 should_be_callable(VALUE block) { if (!rb_obj_respond_to(block, rb_intern("call"), TRUE)) { - rb_raise(rb_eArgError, "wrong type argument %s (should be callable)", - rb_obj_classname(block)); + rb_raise(rb_eArgError, "wrong type argument %"PRIsVALUE" (should be callable)", + rb_obj_class(block)); } } static void Index: test/ruby/test_objectspace.rb =================================================================== --- test/ruby/test_objectspace.rb (revision 47513) +++ test/ruby/test_objectspace.rb (revision 47514) @@ -78,6 +78,11 @@ End https://github.com/ruby/ruby/blob/trunk/test/ruby/test_objectspace.rb#L78 end assert_in_out_err([], code[""], ["finalized"]) assert_in_out_err([], code["private "], ["finalized"]) + c = EnvUtil.labeled_class("C\u{3042}").new + o = Object.new + assert_raise_with_message(ArgumentError, /C\u{3042}/) { + ObjectSpace.define_finalizer(o, c) + } end def test_each_object -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/