X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FMethod%2FDestructor.pm;h=c11ec4d69ab6272944504166ace2f03c8ddb4650;hb=4da72c45030b36f43e7b9bfb15c38276f14db3a6;hp=018bb29505c6734af91d14d09622b15010409d44;hpb=5e60e7d6b0f2d65aa4d735f9b8a8e575467a2b06;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Method/Destructor.pm b/lib/Moose/Meta/Method/Destructor.pm index 018bb29..c11ec4d 100644 --- a/lib/Moose/Meta/Method/Destructor.pm +++ b/lib/Moose/Meta/Method/Destructor.pm @@ -6,7 +6,7 @@ use warnings; use Scalar::Util 'blessed', 'weaken'; -our $VERSION = '0.62_01'; +our $VERSION = '0.68'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -88,8 +88,11 @@ sub initialize_body { $source .= ";\n" . '}'; warn $source if $self->options->{debug}; - my $code = $self->_eval_closure(q{}, $source); - $self->throw_error("Could not eval the destructor :\n\n$source\n\nbecause :\n\n$@", error => $@, data => $source) if $@; + my $code = $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->{'body'} = $code; } @@ -107,7 +110,7 @@ Moose::Meta::Method::Destructor - Method Meta Object for destructors =head1 DESCRIPTION This is a subclass of L which handles -constructing an approprate Destructor method. This is primarily +constructing an appropriate Destructor method. This is primarily used in the making of immutable metaclasses, otherwise it is not particularly useful. @@ -137,7 +140,7 @@ Stevan Little Estevan@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2006-2008 by Infinity Interactive, Inc. +Copyright 2006-2009 by Infinity Interactive, Inc. L