From: Stevan Little Date: Fri, 28 Apr 2006 20:30:34 +0000 (+0000) Subject: done X-Git-Tag: 0_29_02~36 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=052c2a1a011f60e34ce109efdab03995dcf7bfb5;p=gitmo%2FClass-MOP.git done --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index 945cf90..bcdb18d 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -188,7 +188,10 @@ sub construct_instance { sub get_meta_instance { my $class = shift; - $class->{':instance_meta_object_cache'} ||= $class->instance_metaclass->new($class); + return $class->instance_metaclass->new( + $class, + $class->compute_all_applicable_attributes() + ); } sub clone_object { diff --git a/lib/Class/MOP/Instance.pm b/lib/Class/MOP/Instance.pm index b6d6435..10a112d 100644 --- a/lib/Class/MOP/Instance.pm +++ b/lib/Class/MOP/Instance.pm @@ -15,24 +15,14 @@ sub meta { } sub new { - my ($class, $meta) = @_; - my $slots = $class->_compute_slot_list_from_class($meta); + my ($class, $meta, @attrs) = @_; + my @slots = map { $_->name } @attrs; bless { meta => $meta, - slots => $slots, + slots => \@slots, } => $class; } -# private for now ... -sub _compute_slot_list_from_class { - my ($self, $meta) = @_; - return [ - map { - $_->name - } $meta->compute_all_applicable_attributes() - ]; -} - sub create_instance { my $self = shift; $self->bless_instance_structure({});