Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Module#const_defined? checks Object by default in 1.9 [closes #1622]

  • Loading branch information...
commit 3c1bb57dad4191d193a161d6240f5090caedfd27 1 parent 128670f
Xavier Noria fxn authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 kernel/common/module19.rb
6 kernel/common/module19.rb
View
@@ -47,10 +47,14 @@ def const_defined?(name, search_parents=true)
if search_parents
current = self.direct_superclass
- while current and current != Object
+ while current
return true if current.constant_table.has_key? name
current = current.direct_superclass
end
+
+ if instance_of?(Module)
+ return true if Object.constant_table.has_key? name
+ end
end
return false
Please sign in to comment.
Something went wrong with that request. Please try again.