X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2F_Util.pm;fp=lib%2FDBIx%2FClass%2F_Util.pm;h=6d9d7575753a28ca4819ae9da4a783c3559211a5;hp=147614f3c1bec59c9d2cfea7f07e7f389bdfc0f7;hb=a580a22749565b3b07f583bc04412e6dc0c84ab2;hpb=7474ed3b192693baa28d2f52de502f0ec3e8ac4e diff --git a/lib/DBIx/Class/_Util.pm b/lib/DBIx/Class/_Util.pm index 147614f..6d9d757 100644 --- a/lib/DBIx/Class/_Util.pm +++ b/lib/DBIx/Class/_Util.pm @@ -48,7 +48,6 @@ BEGIN { { substr($_, 5) => !!( $ENV{$_} ) } qw( DBIC_SHUFFLE_UNORDERED_RESULTSETS - DBIC_ASSERT_NO_INTERNAL_WANTARRAY DBIC_ASSERT_NO_INTERNAL_INDIRECT_CALLS DBIC_ASSERT_NO_ERRONEOUS_METAINSTANCE_USE DBIC_ASSERT_NO_FAILING_SANITY_CHECKS @@ -198,8 +197,7 @@ BEGIN { *deep_clone = \&Storable::dclone } use base 'Exporter'; our @EXPORT_OK = qw( - sigwarn_silencer modver_gt_or_eq modver_gt_or_eq_and_lt - fail_on_internal_wantarray fail_on_internal_call + sigwarn_silencer modver_gt_or_eq modver_gt_or_eq_and_lt fail_on_internal_call refdesc refcount hrefaddr set_subname get_subname describe_class_methods scope_guard detected_reinvoked_destructor emit_loud_diag true false @@ -1073,58 +1071,6 @@ sub mkdir_p ($) { } -{ - my $list_ctx_ok_stack_marker; - - sub fail_on_internal_wantarray () { - return if $list_ctx_ok_stack_marker; - - if (! defined wantarray) { - croak('fail_on_internal_wantarray() needs a tempvar to save the stack marker guard'); - } - - my $cf = 1; - while ( ( (CORE::caller($cf+1))[3] || '' ) =~ / :: (?: - - # these are public API parts that alter behavior on wantarray - search | search_related | slice | search_literal - - | - - # these are explicitly prefixed, since we only recognize them as valid - # escapes when they come from the guts of CDBICompat - CDBICompat .*? :: (?: search_where | retrieve_from_sql | retrieve_all ) - - ) $/x ) { - $cf++; - } - - my ($fr, $want, $argdesc); - { - package DB; - $fr = [ CORE::caller($cf) ]; - $want = ( CORE::caller($cf-1) )[5]; - $argdesc = ref $DB::args[0] - ? DBIx::Class::_Util::refdesc($DB::args[0]) - : 'non ' - ; - }; - - if ( - $want and $fr->[0] =~ /^(?:DBIx::Class|DBICx::)/ - ) { - DBIx::Class::Exception->throw( sprintf ( - "Improper use of %s instance in list context at %s line %d\n\n Stacktrace starts", - $argdesc, @{$fr}[1,2] - ), 'with_stacktrace'); - } - - weaken( $list_ctx_ok_stack_marker = my $mark = [] ); - - $mark; - } -} - sub fail_on_internal_call { my $fr = [ CORE::caller(1) ];