From: gfx Date: Fri, 26 Feb 2010 06:24:07 +0000 (+0900) Subject: Use @CARP_NOT instead of %Carp::Internal X-Git-Tag: 0.50_04~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=431e4817af5380b349d562cafde91777db982a2a;p=gitmo%2FMouse.git Use @CARP_NOT instead of %Carp::Internal --- diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index a66fb32..10a9450 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -44,6 +44,8 @@ my %valid_options = map { $_ => undef } ( 'curries', ); +our @CARP_NOT = qw(Mouse::Meta::Class); + sub new { my $class = shift; my $name = shift; @@ -76,10 +78,9 @@ sub new { # (3) bad options found if(@bad){ - @bad = sort @bad; - local $Carp::Internal{'Mouse'} = 1; - local $Carp::Internal{'Mouse::Meta::Class'} = 1; - Carp::carp("Found unknown argument(s) passed to '$name' attribute constructor in '$class': @bad"); + Carp::carp( + "Found unknown argument(s) passed to '$name' attribute constructor in '$class': " + . Mouse::Util::english_list(@bad)); } my $self = bless $args, $class; diff --git a/xs-src/MouseUtil.xs b/xs-src/MouseUtil.xs index 8704d89..d8e3f4c 100644 --- a/xs-src/MouseUtil.xs +++ b/xs-src/MouseUtil.xs @@ -108,8 +108,12 @@ mouse_throw_error(SV* const metaobject, SV* const data /* not used */, const cha PUSHs(metaobject); mPUSHs(message); - mPUSHs(newSVpvs("depth")); - mPUSHi(-1); + if(data){ /* extra arg, might be useful for debugging */ + mPUSHs(newSVpsv("data")); + PUSHs(data); + mPUSHs(newSVpvs("depth")); + mPUSHi(-1); + } PUTBACK;