Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/parser/source/tree_rewriter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ def combine(range, attributes)
end

def check_range_validity(range)
unless range.source_buffer.equal?(@source_buffer)
raise ArgumentError, 'The range belongs to a different source buffer'
end
if range.begin_pos < 0 || range.end_pos > @source_buffer.source.size
raise IndexError, "The range #{range.to_range} is outside the bounds of the source"
end
Expand Down