- Make the Optional::Dependencies error messages cpanm-friendly
- Incompatibly change values (not keys) of the hash returned by
Optional::Dependencies::req_group_list (no known users in the wild)
+ - Protect tests and codebase from incomplete caller() overrides, like
+ e.g. RT#32640
0.082820 2015-03-20 20:35 (UTC)
* Fixes
my $fr_num = 1; # skip us and the calling carp*
my (@f, $origin);
- while (@f = caller($fr_num++)) {
+ while (@f = CORE::caller($fr_num++)) {
next if
( $f[3] eq '(eval)' or $f[3] =~ /::__ANON__$/ );
and
#############################
# Need a way to parameterize this for Carp::Skip
- $1 !~ /^(?: DBIx::Class::Storage::BlockRunner | Context::Preserve | Try::Tiny | Class::Accessor::Grouped | Class::C3::Componentised | Module::Runtime )$/x
+ $1 !~ /^(?: DBIx::Class::Storage::BlockRunner | Context::Preserve | Try::Tiny | Class::Accessor::Grouped | Class::C3::Componentised | Module::Runtime | Sub::Uplevel )$/x
and
$2 !~ /^(?: throw_exception | carp | carp_unique | carp_once | dbh_do | txn_do | with_deferred_fk_checks)$/x
#############################
? "at $f[1] line $f[2]"
: Carp::longmess()
;
- $origin ||= '{UNKNOWN}';
return (
$site,
- $origin =~ /::/ ? "$origin(): " : "$origin: ", # cargo-cult from Carp::Clan
+ (
+ # cargo-cult from Carp::Clan
+ ! defined $origin ? ''
+ : $origin =~ /::/ ? "$origin(): "
+ : "$origin: "
+ ),
);
};
# skip all frames that match the original caller, or any of
# the dbic-wide classdata patterns
my ($ln, $calling) = DBIx::Class::Carp::__find_caller(
- '^' . caller() . '$',
+ '^' . CORE::caller() . '$',
'DBIx::Class',
);
}
my $cf = 1;
- while ( ( (caller($cf+1))[3] || '' ) =~ / :: (?:
+ while ( ( (CORE::caller($cf+1))[3] || '' ) =~ / :: (?:
# these are public API parts that alter behavior on wantarray
search | search_related | slice | search_literal
my ($fr, $want, $argdesc);
{
package DB;
- $fr = [ caller($cf) ];
- $want = ( caller($cf-1) )[5];
+ $fr = [ CORE::caller($cf) ];
+ $want = ( CORE::caller($cf-1) )[5];
$argdesc = ref $DB::args[0]
? DBIx::Class::_Util::refdesc($DB::args[0])
: 'non '
my ($fr, $argdesc);
{
package DB;
- $fr = [ caller(1) ];
+ $fr = [ CORE::caller(1) ];
$argdesc = ref $DB::args[0]
? DBIx::Class::_Util::refdesc($DB::args[0])
: undef
$frame++;
my (@stack, @frame);
- while (@frame = caller($frame++)) {
+ while (@frame = CORE::caller($frame++)) {
push @stack, [@frame[3,1,2]];
}
# in case we hooked bless any extra object creation will wreak
# havoc during the assert phase
local *CORE::GLOBAL::bless;
- *CORE::GLOBAL::bless = sub { CORE::bless( $_[0], (@_ > 1) ? $_[1] : caller() ) };
+ *CORE::GLOBAL::bless = sub { CORE::bless( $_[0], (@_ > 1) ? $_[1] : CORE::caller() ) };
croak 'Expecting a registry hashref' unless ref $weak_registry eq 'HASH';
}
if (! $quiet and !$leaks_found and ! $tb->in_todo) {
- $tb->ok(1, sprintf "No leaks found at %s line %d", (caller())[1,2] );
+ $tb->ok(1, sprintf "No leaks found at %s line %d", (CORE::caller())[1,2] );
}
}
local $SIG{__WARN__} = sub {
package DB;
my $frnum;
- while (my @f = caller(++$frnum) ) {
+ while (my @f = CORE::caller(++$frnum) ) {
push @arg_capture, @DB::args;
}
};