Project

General

Profile

Actions

Bug #2967

closed

SCRIPT_LINES__ is not included in constants()

Added by shri (Shri Borde) about 11 years ago. Updated almost 10 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mswin32]
Backport:
[ruby-core:28678]

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

Actions #1

Updated by shri (Shri Borde) about 11 years ago

=begin
Using symbols works. ie Object.constants.include? :SCRIPT_LINES__. So this is not a bug. My bad.

=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) about 11 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

Also available in: Atom PDF