Issue Details (XML | Word | Printable)

Key: JRUBY-149
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Ola Bini
Reporter: Sundararajan
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JRuby

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

Created: 27/Sep/06 01:39 AM   Updated: 30/Apr/07 03:13 AM   Resolved: 25/Nov/06 02:19 PM
Return to search
Component/s: Interpreter
Affects Version/s: JRuby 0.9.0
Fix Version/s: JRuby 0.9.2

Time Tracking:
Not Specified

File Attachments: 1. File test.rb (0.3 kB)

Environment:
JRuby 0.9.0 on Windows through jsr-223 engine
and
Ruby version ruby 1.8.4 (2006-04-14) [i386-mswin32]


 Description  « Hide

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



Ola Bini made changes - 25/Nov/06 02:19 PM
Field Original Value New Value
Resolution Fixed [ 1 ]
Fix Version/s JRuby 0.9.2 [ 12980 ]
Assignee Ola Bini [ olagus ]
Status Open [ 1 ] Resolved [ 5 ]
Charles Oliver Nutter made changes - 30/Apr/07 03:13 AM
Status Resolved [ 5 ] Closed [ 6 ]