Defer escaping control char in error messages

* eval_error.c (print_errinfo): defer escaping control char in
  error messages until writing to stderr, instead of quoting at
  building the message.  [ruby-core:90853] [Bug #15497]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2019-01-08 09:08:31 +00:00
parent e52b102c36
commit 50784a0a44
8 changed files with 106 additions and 39 deletions

View file

@ -745,10 +745,6 @@ class TestModule < Test::Unit::TestCase
assert_raise(NameError) { c1.const_get(:foo) }
bug5084 = '[ruby-dev:44200]'
assert_raise(TypeError, bug5084) { c1.const_get(1) }
bug7574 = '[ruby-dev:46749]'
assert_raise_with_message(NameError, "wrong constant name \"String\\u0000\"", bug7574) {
Object.const_get("String\0")
}
end
def test_const_defined_invalid_name
@ -756,10 +752,6 @@ class TestModule < Test::Unit::TestCase
assert_raise(NameError) { c1.const_defined?(:foo) }
bug5084 = '[ruby-dev:44200]'
assert_raise(TypeError, bug5084) { c1.const_defined?(1) }
bug7574 = '[ruby-dev:46749]'
assert_raise_with_message(NameError, "wrong constant name \"String\\u0000\"", bug7574) {
Object.const_defined?("String\0")
}
end
def test_const_get_no_inherited