Are below behaviors expected in JRuby?
$VERBOSE = true
class Foo
def initialize(bool)
@pre = 1
if bool
singleton_class
end
@post = 2
end
end
p Foo.new(true)
p Foo.new(false)
CRuby
ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
#<Foo:0x858b8b4 @pre=1, @post=2>
#<Foo:0x858b814 @pre=1, @post=2>
JRuby
jruby 1.7.0.preview2 (1.9.3p203) 2012-08-21 82eb396 on OpenJDK Server VM 1.6.0_24-b24 [linux-i386]
#<Foo:0xb655a>
#<Foo:0x2b1682 @pre=1, @post=2>