From: Stevan Little Date: Thu, 23 Nov 2006 17:00:45 +0000 (+0000) Subject: foo X-Git-Tag: 0_37~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9363ea893ea47db99690a480cb163be298e3f1d2;p=gitmo%2FClass-MOP.git foo --- diff --git a/Changes b/Changes index 8268375..265035e 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Revision history for Perl extension Class-MOP. +0.37 + * Class::MOP::Attribute + - default now checks the instance with defined to + avoid setting off bool-overloads (found by Carl Franks) + 0.36 Sun. Nov. 5, 2006 * Class::MOP::Class - added a few 'no warnings' lines to keep annoying diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index f100cec..81dc70b 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -13,7 +13,7 @@ use Class::MOP::Method; use Class::MOP::Class::Immutable; -our $VERSION = '0.36'; +our $VERSION = '0.37'; our $AUTHORITY = 'cpan:STEVAN'; { diff --git a/lib/Class/MOP/Attribute.pm b/lib/Class/MOP/Attribute.pm index 46943b6..3ff383d 100644 --- a/lib/Class/MOP/Attribute.pm +++ b/lib/Class/MOP/Attribute.pm @@ -9,7 +9,7 @@ use Class::MOP::Method::Accessor; use Carp 'confess'; use Scalar::Util 'blessed', 'reftype', 'weaken'; -our $VERSION = '0.13'; +our $VERSION = '0.14'; our $AUTHORITY = 'cpan:STEVAN'; use base 'Class::MOP::Object'; @@ -122,7 +122,7 @@ sub is_default_a_coderef { sub default { my ($self, $instance) = @_; - if ($instance && $self->is_default_a_coderef) { + if (defined $instance && $self->is_default_a_coderef) { # if the default is a CODE ref, then # we pass in the instance and default # can return a value based on that