X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP%2FMethod%2FGenerated.pm;h=1e35f76d19459331f73950f2f5d2c5a619ce5249;hb=cfde7a47afcc5ceef67837c8a463aac89b5b955f;hp=34667470b2ff38e643dfa25bb47fe1f759372ec7;hpb=28fa06b5d932b8a2f9bc1b6b394893c0d7c9efac;p=gitmo%2FClass-MOP.git diff --git a/lib/Class/MOP/Method/Generated.pm b/lib/Class/MOP/Method/Generated.pm index 3466747..1e35f76 100644 --- a/lib/Class/MOP/Method/Generated.pm +++ b/lib/Class/MOP/Method/Generated.pm @@ -12,32 +12,12 @@ our $AUTHORITY = 'cpan:STEVAN'; use base 'Class::MOP::Method'; -sub new { - my $class = shift; - my %options = @_; - - ($options{package_name} && $options{name}) - || confess "You must supply the package_name and name parameters $Class::MOP::Method::UPGRADE_ERROR_TEXT"; - - my $self = $class->_new(\%options); - - $self->initialize_body; - - return $self; -} - -sub _new { - my $class = shift; - my $options = @_ == 1 ? $_[0] : {@_}; - - $options->{is_inline} ||= 0; - $options->{body} ||= undef; +## accessors - bless $options, $class; +sub new { + confess __PACKAGE__ . " is an abstract base class, you must provide a constructor."; } -## accessors - sub is_inline { $_[0]{is_inline} } sub definition_context { $_[0]{definition_context} } @@ -49,9 +29,7 @@ sub initialize_body { sub _eval_closure { # my ($self, $captures, $sub_body) = @_; my $__captures = $_[1]; - - local $@; - my $code = join( + eval join( "\n", ( map { @@ -67,11 +45,6 @@ sub _eval_closure { ), $_[2] ); - my $sub = eval $code; - - die "$@\n$code" if $@; - - return $sub; } sub _add_line_directive { @@ -156,7 +129,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