Carp::carp(qq{Attribute ($name) of class }.$self->name
.qq{ has no associated methods (did you mean to provide an "is" argument?)});
}
+
if(!Mouse::Util::MOUSE_XS) {
+ # in Mouse::PurePerl, attribute initialization code is cached, so it
+ # must be clear here. See _initialize_object() in Mouse::PurePerl.
delete $self->{_initialize_object};
}
return $attr;
my $cloned = bless { %$object }, ref $object;
$class->_initialize_object($cloned, $args, 1);
-
return $cloned;
}
sub _initialize_object{
my($self, $object, $args, $is_cloning) = @_;
+ # The initializer, which is used everywhere, must be clear
+ # when an attribute is added. See Mouse::Meta::Class::add_attribute.
my $initializer = $self->{_initialize_object} ||= do {
Mouse::Util::load_class($self->constructor_class)
->_generate_initialize_object($self);