X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FMethod%2FAccessor.pm;h=957ba1606e41864b8c34714b956126cb4d9fdf30;hb=6f94c802188d44415bafdd64422cecd24585a289;hp=e4a5f29cd36a1d2f12df4c33e651a403e8fbda5a;hpb=d03bd989b97597428b460d7f9a021e2931893fa0;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Method/Accessor.pm b/lib/Moose/Meta/Method/Accessor.pm index e4a5f29..957ba16 100644 --- a/lib/Moose/Meta/Method/Accessor.pm +++ b/lib/Moose/Meta/Method/Accessor.pm @@ -4,7 +4,7 @@ package Moose::Meta::Method::Accessor; use strict; use warnings; -our $VERSION = '0.75_01'; +our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -17,7 +17,7 @@ sub _error_thrower { } sub _eval_code { - my ( $self, $code ) = @_; + my ( $self, $source ) = @_; # NOTE: # set up the environment @@ -34,9 +34,15 @@ sub _eval_code { : undef), }; - #warn "code for $attr_name =>\n" . $code . "\n"; - $self->_compile_code( environment => $environment, code => $code ) - or $self->throw_error("Could not create writer for '${\$self->associated_attribute->name}' because $@ \n code: $code", error => $@, data => $code ); + #warn "code for $attr_name =>\n" . $source . "\n"; + my ( $code, $e ) = $self->_compile_code( environment => $environment, code => $source ); + + $self->throw_error( + "Could not create writer for '${\$self->associated_attribute->name}' because $e \n code: $source", + error => $e, data => $source ) + if $e; + + return $code; } sub _generate_accessor_method_inline { @@ -291,12 +297,12 @@ Moose::Meta::Method::Accessor - A Moose Method metaclass for accessors =head1 DESCRIPTION -This class is a subclass of L that +This class is a subclass of L that provides additional Moose-specific functionality, all of which is private. To understand this class, you should read the the -L documentation. +L documentation. =head1 BUGS