Skip to content

Commit 7ad2d4c

Browse files
committed
* golf_prelude.rb (Object.const_missing): No need to delegate to
superclass. Just raise a NameError when none matches. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 9343a2d commit 7ad2d4c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Fri Dec 28 13:45:21 2007 Akinori MUSHA <knu@iDaemons.org>
2+
3+
* golf_prelude.rb (Object.const_missing): No need to delegate to
4+
superclass. Just raise a NameError when none matches.
5+
16
Fri Dec 28 13:18:47 2007 Kouhei Sutou <kou@cozmixng.org>
27

38
* lib/rss/rss.rb, test/rss/test_version.rb: 0.2.2 -> 0.2.3.

golf_prelude.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ def method_missing m, *a, &b
99

1010
def self.const_missing c
1111
r = /^#{c}/
12-
t = constants.sort.find{|e|r=~e}
13-
t ? const_get(t) : superclass.const_get(c)
12+
t = constants.sort.find{|e|r=~e} and return const_get(t)
13+
raise NameError, "uninitialized constant #{c}", caller(1)
1414
end
1515

1616
def h(a='H', b='w', c='!')

0 commit comments

Comments
 (0)