mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/irb] Rescue a specific error
Rescuing StandardError is prone to bugs caused by a typo or obsoleted methods. https://github.com/ruby/irb/commit/eb5260fcd5
This commit is contained in:
parent
e8c2b03ee1
commit
acbddbe68c
1 changed files with 1 additions and 1 deletions
|
@ -24,7 +24,7 @@ module IRB
|
|||
end
|
||||
|
||||
def dump_methods(o, klass, obj)
|
||||
singleton_class = obj.singleton_class rescue nil
|
||||
singleton_class = begin obj.singleton_class; rescue TypeError; nil end
|
||||
maps = class_method_map((singleton_class || klass).ancestors)
|
||||
maps.each do |mod, methods|
|
||||
name = mod == singleton_class ? "#{klass}.methods" : "#{mod}#methods"
|
||||
|
|
Loading…
Reference in a new issue