mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 00:54:01 +02:00
error.c: check redefined backtrace result
* error.c (rb_get_backtrace): check the result of `backtrace` even if the method is redefined. [ruby-core:87013] [Bug #14756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1e8ff0de5a
commit
6f0de6ed98
2 changed files with 17 additions and 5 deletions
|
@ -1236,6 +1236,16 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
|
|||
raise RuntimeError, "hello"
|
||||
}
|
||||
end;
|
||||
|
||||
error_class = Class.new(StandardError) do
|
||||
def backtrace; :backtrace; end
|
||||
end
|
||||
begin
|
||||
raise error_class
|
||||
rescue error_class => e
|
||||
assert_raise(TypeError) {$@}
|
||||
assert_raise(TypeError) {e.full_message}
|
||||
end
|
||||
end
|
||||
|
||||
def test_backtrace_in_eval
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue