JRuby

ancestors() on a singleton class returns result different from Ruby 1.8.4

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: JRuby 0.9.0
  • Fix Version/s: JRuby 0.9.2
  • Component/s: Interpreter
  • Labels:
    None
  • Environment:
    JRuby 0.9.0 on Windows through jsr-223 engine
    and
    Ruby version ruby 1.8.4 (2006-04-14) [i386-mswin32]
  • Number of attachments :
    1

Description

Ruby the native implementation seems to hide all singleton classes in ancestor() call. But, JRuby 0.9.0 returns singleton classes.

  1. The output of the following
  2. script is different from that of
  3. Ruby 1.8.4

class Object
def singleton
class<<self; self; end
end
end

class Person
end

class Employee < Person
end

puts Employee.singleton.ancestors().join("\n")

Output with JRuby 0.9.0 is as follows:

#<Class:Employee>
#<Class:Person>
#<Class:Object>
Class
Module
Object
Kernel

Output with Ruby 1.8.4 is as follows:

Class
Module
Object
Kernel

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: