X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FMethod%2FDestructor.pm;h=98121fc8721ff5699108ca2c6210afc4ccb969b7;hb=92d8204181e20d7b6a0144fca0a99095a7788ff4;hp=31dce9cbab4897348088205fcc1b4951d67effe0;hpb=3ee7b5ad664d6b70cb48914bda65cc5c9b905baa;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Method/Destructor.pm b/lib/Moose/Meta/Method/Destructor.pm index 31dce9c..98121fc 100644 --- a/lib/Moose/Meta/Method/Destructor.pm +++ b/lib/Moose/Meta/Method/Destructor.pm @@ -6,12 +6,12 @@ use warnings; use Scalar::Util 'blessed', 'weaken'; -our $VERSION = '0.80'; +our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; use base 'Moose::Meta::Method', - 'Class::MOP::Method::Generated'; + 'Class::MOP::Method::Inlined'; sub new { my $class = shift; @@ -96,10 +96,15 @@ sub _initialize_body { warn $source if $self->options->{debug}; - my $code = $self->_compile_code( + my ( $code, $e ) = $self->_compile_code( environment => {}, code => $source, - ) or $self->throw_error("Could not eval the destructor :\n\n$source\n\nbecause :\n\n$@", error => $@, data => $source); + ); + + $self->throw_error( + "Could not eval the destructor :\n\n$source\n\nbecause :\n\n$e", + error => $e, data => $source ) + if $e; $self->{'body'} = $code; }