[Moose-commits] r7321 -
Moose/branches/method_generation_cleanup/lib/Moose/Meta/Method
nothingmuch at code2.0beta.co.uk
nothingmuch at code2.0beta.co.uk
Sat Jan 17 22:03:27 GMT 2009
Author: nothingmuch
Date: 2009-01-17 14:03:26 -0800 (Sat, 17 Jan 2009)
New Revision: 7321
Modified:
Moose/branches/method_generation_cleanup/lib/Moose/Meta/Method/Destructor.pm
Log:
use _compile_code in Destructor
Modified: Moose/branches/method_generation_cleanup/lib/Moose/Meta/Method/Destructor.pm
===================================================================
--- Moose/branches/method_generation_cleanup/lib/Moose/Meta/Method/Destructor.pm 2009-01-17 22:03:09 UTC (rev 7320)
+++ Moose/branches/method_generation_cleanup/lib/Moose/Meta/Method/Destructor.pm 2009-01-17 22:03:26 UTC (rev 7321)
@@ -88,11 +88,11 @@
$source .= ";\n" . '}';
warn $source if $self->options->{debug};
- my $code;
- {
- $code = eval $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;
}
More information about the Moose-commits
mailing list