Skip to content

SCRIPT_LINES__ is set to nil if you require ripper. #7677

@enebo

Description

@enebo
jruby -r ripper -e 'puts "YES" unless defined? SCRIPT_LINES__'

crickets....

mri31 -r ripper -e 'puts "YES" unless defined? SCRIPT_LINES__'
YES

So this has been this way for a decade so I am unclear why I am seeing issues using debug gem now on 9.3/4.

The problem here also is that linecache gem is not setting SCRIPT_LINES__ to {} which makes it blow later. I guess the combination of how things load probably prevented us from noticing this.

There is a line in MRI:

    rb_define_global_const("SCRIPT_LINES__", Qnil);

but upon inspection it is in an #if 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions