Skip to content

Commit

Permalink
The bizarre-copy bug fix as per Nicholas' advice in
Browse files Browse the repository at this point in the history
in http://rt.perl.org/rt3/Public/Bug/Display.html?id=52610#txn-713770

The problem is that t/stacktrace.t is written in a way that *relies*
on the buggy behavior (expects this module to hide @db::args from
a potential croak()). Since t/stacktrace.t pre-dates the VCS history
I am not sure how to proceed with "fixing" this...
  • Loading branch information
ribasushi authored and adrianh committed Aug 19, 2010
1 parent 3a355a1 commit 2f6200a
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions lib/Test/Exception.pm
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,24 @@ will not catch this with any of its testing functions.
sub _quiet_caller (;$) { ## no critic Prototypes
my $height = $_[0];
$height++;
if( wantarray and !@_ ) {
return (CORE::caller($height))[0..2];

if ( CORE::caller() eq 'DB' ) {
# passthrough the @DB::args trick
package DB;
if( wantarray and !@_ ) {
return (CORE::caller($height))[0..2];
}
else {
return CORE::caller($height);
}
}
else {
return CORE::caller($height);
if( wantarray and !@_ ) {
return (CORE::caller($height))[0..2];
}
else {
return CORE::caller($height);
}
}
}

Expand Down

0 comments on commit 2f6200a

Please sign in to comment.