summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-08 16:16:17 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-08 16:16:17 +0000
commitd56c6580304c4ff8268e00a8a54d69a4f4877d9f (patch)
treefa4744a96e79c7b2e2dd51acf6821749219d6dc8
parentf3b9acda2155012aa982af21aa6e951b0c062209 (diff)
* 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
-rw-r--r--ChangeLog5
-rw-r--r--lib/irb/completion.rb5
2 files changed, 6 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a6a00a44ea..f7150d0a5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Apr 9 01:12:07 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * lib/irb/completion.rb (CompletionProc): calling the method "methods"
+ may raise an exception. [ruby-core:28366]
+
Thu Apr 8 14:33:24 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
* configure.in: --disable-install-doc should prohibit doxygen.
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}