Project

General

Profile

Actions

Feature #7434

closed

Allow caller_locations and backtrace_locations to receive negative params

Added by sam.saffron (Sam Saffron) almost 12 years ago. Updated almost 8 years ago.

Status:
Closed
Target version:
[ruby-core:50092]

Description

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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0