X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FMethod%2FConstructor.pm;h=9d8fc18204fa7d5e236abad958d054a738acb736;hb=a62dcd43575e3069a70277082c7be85fb71322bf;hp=98e419b25644a0302057b1028416521821b8556d;hpb=eae37c67268fb05d0f2bc5473c38710a4a726f11;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Method/Constructor.pm b/lib/Moose/Meta/Method/Constructor.pm index 98e419b..9d8fc18 100644 --- a/lib/Moose/Meta/Method/Constructor.pm +++ b/lib/Moose/Meta/Method/Constructor.pm @@ -6,7 +6,7 @@ use warnings; use Scalar::Util 'blessed', 'weaken', 'looks_like_number'; -our $VERSION = '0.71'; +our $VERSION = '0.71_01'; our $AUTHORITY = 'cpan:STEVAN'; use base 'Moose::Meta::Method', @@ -177,7 +177,7 @@ sub initialize_body { '@type_constraint_bodies' => \@type_constraint_bodies, }, ) or $self->throw_error("Could not eval the constructor :\n\n$source\n\nbecause :\n\n$@", error => $@, data => $source ); - + $self->{'body'} = $code; } @@ -190,7 +190,7 @@ sub _generate_BUILDARGS { return join("\n", 'do {', $self->_inline_throw_error('"Single parameters to new() must be a HASH ref"', 'data => $_[0]'), - ' if scalar @_ == 1 && defined $_[0] && ref($_[0]) ne q{HASH};', + ' if scalar @_ == 1 && !( defined $_[0] && ref $_[0] eq q{HASH} );', '(scalar @_ == 1) ? {%{$_[0]}} : {@_};', '}', );