Permalink
Browse files

Fix ObjectSpace#loaded_features for unnamed class names that have no …

…valid constant names
  • Loading branch information...
1 parent 8b01512 commit e42c0505ac820e104b3a55e8697b29faf3d7678e @timfel timfel committed Aug 18, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/kernel/bootstrap/ObjectSpace.rb
@@ -141,7 +141,7 @@ def loaded_classes(include_modules=true)
# or an Array of Classes and Module which are loaded in memory.
# does not include meta classes, meta modules, or virtual classes.
Repository.__loaded_classes(!!include_modules).select do |c|
- c.name.include?("::") || Object.const_defined?(c.name)
+ c.name.include?("::") || (Object.const_defined?(c.name) rescue false)
end
end

0 comments on commit e42c050

Please sign in to comment.