Issue #7434 has been reported by sam.saffron (Sam Saffron).

----------------------------------------
Feature #7434: Allow caller_locations and backtrace_locations to receive negative params
https://bugs.ruby-lang.org/issues/7434

Author: sam.saffron (Sam Saffron)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 


Further to http://bugs.ruby-lang.org/issues/7051 

It would be nice if caller_locations and backtrace_locations has some parity with range apis.

pry(main)> [1,2,3][0..-2]
=> [1, 2]

Similarly: 

caller_locations(0,-2) # should strip the bottom frame 

This is actually quite important for diagnostics of Rails and other frameworks where the app code starts at a very deep frame. 

At the moment you are forced to materialize all frames just to discard. 







-- 
http://bugs.ruby-lang.org/