Make sure we always local-ize $@ and $SIG{__DIE__} for code evals.
[gitmo/Class-MOP.git] / lib / Class / MOP / Method / Constructor.pm
index a4dc3d3..c30e0f4 100644 (file)
@@ -7,7 +7,7 @@ use warnings;
 use Carp         'confess';
 use Scalar::Util 'blessed', 'weaken', 'looks_like_number';
 
-our $VERSION   = '0.82_01';
+our $VERSION   = '0.86';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -136,11 +136,11 @@ sub _generate_constructor_method_inline {
     $source .= ";\n" . '}';
     warn $source if $self->options->{debug};
 
-    my $code = $self->_eval_closure(
+    my ( $code, $e ) = $self->_eval_closure(
         $close_over,
         $source
     );
-    confess "Could not eval the constructor :\n\n$source\n\nbecause :\n\n$@" if $@;
+    confess "Could not eval the constructor :\n\n$source\n\nbecause :\n\n$e" if $e;
 
     return $code;
 }
@@ -266,12 +266,6 @@ inlined.
 
 This returns the L<Class::MOP::Class> object for the method.
 
-=item B<< $metamethod->can_be_inlined >>
-
-This method always returns true in this class. It exists so that
-subclasses (as in Moose) can do some sort of checking to determine
-whether or not inlining the constructor is safe.
-
 =back
 
 =head1 AUTHORS