mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
vm_insnhelper.c: preserve encoding
* vm_insnhelper.c (vm_getivar): preserve variable name encoding in warning message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6948188f38
commit
bd2d094aab
2 changed files with 6 additions and 1 deletions
|
@ -1826,6 +1826,11 @@ class TestModule < Test::Unit::TestCase
|
|||
assert_warning '' do
|
||||
assert_equal(42, a.ivar)
|
||||
end
|
||||
|
||||
name = "@\u{5909 6570}"
|
||||
assert_warning(/instance variable #{name} not initialized/) do
|
||||
assert_nil(a.instance_eval(name))
|
||||
end
|
||||
end
|
||||
|
||||
def test_uninitialized_attr
|
||||
|
|
|
@ -527,7 +527,7 @@ vm_getivar(VALUE obj, ID id, IC ic, rb_call_info_t *ci, int is_attr)
|
|||
|
||||
if (UNLIKELY(val == Qundef)) {
|
||||
if (!is_attr && RTEST(ruby_verbose))
|
||||
rb_warning("instance variable %s not initialized", rb_id2name(id));
|
||||
rb_warning("instance variable %"PRIsVALUE" not initialized", QUOTE_ID(id));
|
||||
val = Qnil;
|
||||
}
|
||||
return val;
|
||||
|
|
Loading…
Reference in a new issue