Skip to content

Commit

Permalink
Re-allow skipping of the bottom stack frames (which is useful in the …
Browse files Browse the repository at this point in the history
…test-failure repl)
  • Loading branch information
sartak committed Aug 12, 2008
1 parent 7329796 commit 21d4e6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Carp/REPL.pm
Expand Up @@ -27,7 +27,7 @@ sub import {
*Test::Builder::ok = sub {
local $Test::Builder::Level = $Test::Builder::Level + 1;
my $passed = $ok->(@_);
$bottom_frame = $Test::Builder::Level;
local $bottom_frame = $Test::Builder::Level;
repl("Test failure") if !$passed;
return $passed;
};
Expand Down
4 changes: 4 additions & 0 deletions lib/Devel/REPL/Plugin/Carp/REPL.pm
Expand Up @@ -24,6 +24,10 @@ has stacktrace => (
until @{ $stacktrace->{raw} } == 0
|| $stacktrace->{raw}[0]{caller}[3] eq 'Carp::REPL::repl';

shift @{ $stacktrace->{raw} }
until @{ $stacktrace->{raw} } == 0
|| $Carp::REPL::bottom_frame-- <= 0;

return $stacktrace;
},
);
Expand Down

0 comments on commit 21d4e6f

Please sign in to comment.