mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
gc.c: preserve encoding
* gc.c (should_be_callable): preserve encoding of class name in error messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
826341c718
commit
24974c0ea1
2 changed files with 7 additions and 2 deletions
4
gc.c
4
gc.c
|
@ -2279,8 +2279,8 @@ static void
|
|||
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
|
||||
|
|
|
@ -78,6 +78,11 @@ End
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue