[MacRuby-devel] [MacRuby] #297: ObjectSpace.each_object returns Class and Module objects when it shouldn't

MacRuby ruby-noreply at macosforge.org
Sat Jul 18 09:36:48 PDT 2009


#297: ObjectSpace.each_object returns Class and Module objects when it shouldn't
--------------------------------+-------------------------------------------
 Reporter:  ned@…               |       Owner:  lsansonetti@…        
     Type:  defect              |      Status:  new                  
 Priority:  minor               |   Milestone:  MacRuby 0.5          
Component:  MacRuby             |    Keywords:                       
--------------------------------+-------------------------------------------
 each_object(someclass) returns objects that are not subclasses of the
 requested class.

 {{{
 ObjectSpace.each_object(String).reject { |o| o.class.ancestors.include?
 String }.map  { |o| o.class }.uniq
 => [Class, Module, NSString]
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/297>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list