Project

General

Profile

Actions

Backport #4229

closed

Thread#raise 3rd form arguments ignored

Added by djberg96 (Daniel Berger) about 13 years ago. Updated over 4 years ago.

Status:
Closed
Assignee:
-
[ruby-core:34014]

Description

=begin
It seems that at one point the Thread#raise method was documented to accept an array as the 3rd argument. As it stands now it appears to accept either a string or an array. But, if an array is provided, only the first argument is used. I think this ties back to the code in rb_make_exception in eval.c. For example:

 thread = Thread.new{ sleep }
 Thread.pass until thread.status == 'sleep'
 thread.raise(NameError, 'hello', ['foo', 'bar', 'baz'])

 begin
   thread.join
 rescue NameError => err
   puts err.to_s
   puts err.backtrace.join("\n")
 end

The result is:

 hello
 foo
 test.rb:8:in `join'
 test.rb:8

Note that 'bar' and 'baz' were apparently dropped from any part of the backtrace.

Can you please clarify the spec?
=end

Actions #1

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby 1.8 to Backport187
  • Description updated (diff)
  • Status changed from Open to Closed
  • Target version deleted (Ruby 1.8.7)
  • ruby -v deleted (ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10.4.0])
Actions

Also available in: Atom PDF

Like0
Like0