From: "zzak (Zachary Scott)" <zachary@...>
Date: 2012-11-26T07:50:45+09:00
Subject: [ruby-core:50102] [ruby-trunk - Feature #7434][Assigned] Allow caller_locations and backtrace_locations to receive negative params


Issue #7434 has been updated by zzak (Zachary Scott).

Category set to core
Status changed from Open to Assigned
Assignee set to ko1 (Koichi Sasada)
Target version set to 2.0.0


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

Author: sam.saffron (Sam Saffron)
Status: Assigned
Priority: Normal
Assignee: ko1 (Koichi Sasada)
Category: core
Target version: 2.0.0


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/