Permalink
Browse files

Only prefix const_missing in the message of it's not in Object

Fixes #1922
  • Loading branch information...
1 parent b75f4f5 commit 0fcb78a0cf750563980499c0c4ad1ab93621f8ec @dbussink dbussink committed Sep 27, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 kernel/common/module.rb
View
@@ -464,8 +464,10 @@ def const_set(name, value)
# with the name.
def const_missing(name)
- mod_name = Rubinius::Type.module_name self
- raise NameError, "Missing or uninitialized constant: #{mod_name}::#{name}"
+ unless self == Object
+ mod_name = "#{Rubinius::Type.module_name self}::"
+ end
+ raise NameError, "Missing or uninitialized constant: #{mod_name}#{name}"
end
def <(other)

0 comments on commit 0fcb78a

Please sign in to comment.