lib/iseq_extra.rb in rb-threadframe-0.34 vs lib/iseq_extra.rb in rb-threadframe-0.35
- old
+ new
@@ -86,23 +86,20 @@
# nil if nothing is found, else an array of size 2 containing the method
# the line was found in and the offset pointing there.
def locate_line_with_children(line)
iseq = self
offset = iseq.locate_line(line)
- p ['++++1', offset, iseq]
return iseq, offset if offset
# Didn't find line in this iseq, so check if a contained
# InstructionSequence encompasses the line searched for
until offset
- child_iseq = iseq
+ current_iseq = iseq
iseq = iseq.parent
unless iseq
- # child_iseq is the top-most scope. Search down from here.
- top_iseq = child_iseq
+ # current_iseq is the top-most scope. Search down from here.
top_iseq.child_iseqs.each do |child_iseq|
- p ['++++2', offset, child_iseq, child_iseq.parent]
- next if child_iseq.equal? top_iseq
+ next if child_iseq.equal? current_iseq
if res = child_iseq.locate_line_with_children(line)
return res
end
end
# No child method is a match - fail