From: Matt Phillips Date: Tue, 30 Apr 2013 14:59:46 +0000 (-0400) Subject: squash, cleanup on _validate_codulatable X-Git-Tag: v1.002000~19 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eb100447a7447ba6620bff6e246d5fc86ecd2c7c;p=gitmo%2FMoo.git squash, cleanup on _validate_codulatable --- diff --git a/lib/Method/Generate/Accessor.pm b/lib/Method/Generate/Accessor.pm index cdba23f..2aad0e1 100644 --- a/lib/Method/Generate/Accessor.pm +++ b/lib/Method/Generate/Accessor.pm @@ -570,13 +570,18 @@ sub default_construction_string { '{}' } sub _validate_codulatable { my ($self, $setting, $value, $into, $appended) = @_; - $appended ||= ''; my $invalid = "Invalid $setting '" . overload::StrVal($value) - . "' for $into not a coderef $appended"; - die "$invalid or code-convertible object" - unless ref $value and (ref $value eq 'CODE' or blessed($value)); - die "$invalid and could not be converted to a coderef: $@" - if !eval { \&$value }; + . "' for $into not a coderef"; + $invalid .= " $appended" if $appended; + + unless (ref $value and (ref $value eq 'CODE' or blessed($value))) { + die "$invalid or code-convertible object"; + } + + unless (eval { \&$value }) { + die "$invalid and could not be converted to a coderef: $@"; + } + 1; } diff --git a/lib/Moo.pm b/lib/Moo.pm index 4ef6ab1..61f02b2 100644 --- a/lib/Moo.pm +++ b/lib/Moo.pm @@ -652,8 +652,6 @@ given attributes specifications if necessary when upgrading to a Moose role or class. You shouldn't need this by default, but is provided as a means of possible extensibility. -L - =back =head2 before