End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
RubyVM::InstructionSequence#script_lines
iseq.script_lines → array or nil
iseq.c
View on GitHub ↗
static VALUE
iseqw_script_lines(VALUE self)
{
const rb_iseq_t *iseq = iseqw_check(self);
return ISEQ_BODY(iseq)->variable.script_lines;
}
It returns recorded script lines if it is availalble. The script lines are not limited to the iseq range, but are entire lines of the source file.
Note that this is an API for ruby internal use, debugging, and research. Do not use this for any other purpose. The compatibility is not guaranteed.