Project

General

Profile

Actions

Backport #5755

closed

Errors raised and rescued in Kernel#loaded file still propagate

Added by now (Nikolai Weibull) over 12 years ago. Updated about 12 years ago.


Description

a.rb:

load 'b.rb'

b.rb:

begin
BasicObject.new.inspect
rescue => e
p e
end

% ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33569) [x86_64-darwin10.8.0]
% ruby a.rb
#<NoMethodError: undefined method inspect' for #<BasicObject:0x0000010090b388>> b.rb:4:in to_str': undefined method inspect' for #<BasicObject:0x0000010090b388> (NoMethodError) from b.rb:4:in to_s'
from b.rb:4:in inspect' from b.rb:4:in p'
from b.rb:4:in rescue in <top (required)>' from b.rb:1:in <top (required)>'
from a.rb:1:in load' from a.rb:1:in '
% ruby b.rb
#<NoMethodError: undefined method `inspect' for #BasicObject:0x0000010090b388>

This is a bug, right?


Files

bug_5755.patch (590 Bytes) bug_5755.patch nagachika (Tomoyuki Chikanaga), 12/13/2011 12:24 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0