From d56c6580304c4ff8268e00a8a54d69a4f4877d9f Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 8 Apr 2010 16:16:17 +0000 Subject: * lib/irb/completion.rb (CompletionProc): calling the method "methods" may raise an exception. [ruby-core:28366] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/irb/completion.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index 459f856dfe..6ba168e813 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -138,10 +138,7 @@ module IRB lv = eval("local_variables", bind).collect{|m| m.to_s} cv = eval("self.class.constants", bind).collect{|m| m.to_s} - if (gv | lv | cv).include?(receiver) - # foo.func and foo is local var. - candidates = eval("#{receiver}.methods", bind).collect{|m| m.to_s} - elsif /^[A-Z]/ =~ receiver and /\./ !~ receiver + if (gv | lv | cv).include?(receiver) || /^[A-Z]/ =~ receiver and /\./ !~ receiver # Foo::Bar.func begin candidates = eval("#{receiver}.methods", bind).collect{|m| m.to_s} -- cgit v1.2.3