* unit test improvements - tighter TODO scopes, better diagnostics on
failure, Test::Moose for cleaner logic
* fix documentation referencing Moose changes that are still TBD
+ * undef attr values being stripped at construction time are now removed
+ from visibility of all attr initializations, not just the one being
+ updated at the time
0.12 2011-04-03
* This module can now be used in roles with Moose 1.9900+. (Jesse Luehrs)
around('initialize_instance_slot', sub {
my $orig = shift;
my $self = shift;
+ my ($meta_instance, $instance, $params) = @_;
my $key_name = $self->init_arg;
- # $_[2] is the hashref of options passed to the constructor.
- # If our parameter passed in was undef, pop it off the args...
+ # If our parameter passed in was undef, remove it from the parameter list...
# but leave the value unscathed if the attribute's type constraint can
# handle undef (or doesn't have one, which implicitly means it can)
- if (not defined $key_name or not defined($_[2]->{$key_name}))
+ if (not defined $key_name or not defined($params->{$key_name}))
{
my $type_constraint = $self->type_constraint;
if ($type_constraint and not $type_constraint->check(undef))
{
- pop;
+ delete $params->{$key_name};
}
}