Project

General

Profile

Actions

Bug #17419

closed

`binding.eval` backtrace differente

Added by vo.x (Vit Ondruch) almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.0rc1 (2020-12-20 master 8680ae9cbd) [x86_64-linux]
[ruby-core:101595]

Description

Can somebody elaborate why there is different output for Ruby 2.7 vs Ruby 3.0?

$ ruby -v
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]

$ ruby -e '                                                                                                                                         
begin
binding.eval(%|raise "oops"|)
rescue Exception => exc
puts exc.backtrace
end
'
-e:3:in `<main>'
-e:3:in `eval'
-e:3:in `<main>'
$ ruby -v
ruby 3.0.0rc1 (2020-12-20 master 8680ae9cbd) [x86_64-linux]

$ ruby -e '                                                                                                                                         
begin
binding.eval(%|raise "oops"|)
rescue Exception => exc
puts exc.backtrace
end
'
(eval):1:in `<main>'
-e:3:in `eval'
-e:3:in `<main>'

IOW the first line of backtrace is different. Is this expected? This is causing test failures:

https://github.com/rails/web-console/issues/301


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #17160: Wrong exception backtraceRejectedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0