Actions
Bug #15558
closedShould Exception#exception copy the backtrace?
Description
Currently it does not on MRI:
ruby -e 'begin raise "foo"; rescue => e; c=e.exception "bar"; p c.backtrace; end'
nil
But it does on JRuby 9.2.5.0 and TruffleRuby 1.0.0-rc11:
truffleruby -e 'begin raise "foo"; rescue => e; c=e.exception "bar"; p e.backtrace; end'
["-e:1:in `<main>'"]
This means in some cases, code needs about this difference such as in
https://github.com/asciidoctor/asciidoctor/blob/41da20a47a8da96966ef3ec1c2f509e07e7920e3/lib/asciidoctor.rb#L1322-L1338
More context in:
https://github.com/oracle/truffleruby/issues/1542#issuecomment-456850066
Actions
Like0
Like0Like0Like0Like0Like0Like0