Actions
Bug #5938
closedirb crashes on 2nd level tab complete if Module#name returns regexp
Description
ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
Copy this into irb and press tab :)
module Foo
def self.name
/foo/
end
end
[1].first.
In irb/completion.rb line 177:
name = m.name (where m is the module)
later
/some|stuff/ =~ name
If name is a regexp, boom.
Probably
name = m.name
should be
name = m.name.to_s
Since if that causes an exception it is already handled and name is set to "" or it will be harmlessly converted to a string.
Or the next if condition should also have a being/rescue around it.
Actions
Like0
Like0Like0