Actions
Bug #2967
closedSCRIPT_LINES__ is not included in constants()
Description
=begin
d:\bugs>irb
irb(main):001:0> RUBY_VERSION
=> "1.8.6"
irb(main):002:0> SCRIPT_LINES__ = {}
=> {}
irb(main):003:0> Object.constants.include? 'SCRIPT_LINES__'
=> true
irb(main):004:0> exit
d:\bugs>irb19
irb(main):001:0> RUBY_VERSION
=> "1.9.1"
irb(main):002:0> SCRIPT_LINES__ = {}
=> {}
irb(main):003:0> Object.constants.include? 'SCRIPT_LINES__'
=> false
irb(main):006:0> exit
=end
Updated by shri (Shri Borde) over 14 years ago
=begin
Using symbols works. ie Object.constants.include? :SCRIPT_LINES__. So this is not a bug. My bad.
=end
Updated by nobu (Nobuyoshi Nakada) over 14 years ago
- Status changed from Open to Rejected
=begin
Use const_defined? which can work either on 1.8 and 1.9, and faster.
=end
Actions
Like0
Like0Like0