From: Jesse Luehrs Date: Sun, 21 Jun 2009 20:34:10 +0000 (-0500) Subject: just use _construct_instance from CMOP X-Git-Tag: 0.83~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a6556c221ffe6bd5e85e4b33b5553f65510565fb;p=gitmo%2FMoose.git just use _construct_instance from CMOP --- diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index a83ee1d..8908dfa 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -227,21 +227,6 @@ sub new_object { return $self; } -sub _construct_instance { - my $class = shift; - my $params = @_ == 1 ? $_[0] : {@_}; - my $meta_instance = $class->get_meta_instance; - # FIXME: - # the code below is almost certainly incorrect - # but this is foreign inheritance, so we might - # have to kludge it in the end. - my $instance = $params->{'__INSTANCE__'} || $meta_instance->create_instance(); - foreach my $attr ($class->get_all_attributes()) { - $attr->initialize_instance_slot($meta_instance, $instance, $params); - } - return $instance; -} - sub superclasses { my $self = shift; my @supers = @_;