From: Jesse Luehrs Date: Fri, 2 Apr 2010 20:47:33 +0000 (-0500) Subject: don't call $self->initialize, call CMOP::Class->initialize X-Git-Tag: 1.02~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=03ed0014e2f7f4733ac034a7cb7e162fc4aebbf0;p=gitmo%2FClass-MOP.git don't call $self->initialize, call CMOP::Class->initialize now that metaclass compat fixing works, let that take care of picking the correct metaclass --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index bf37fab..56951c3 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -747,7 +747,7 @@ sub find_attribute_by_name { foreach my $class ( $self->linearized_isa ) { # fetch the meta-class ... - my $meta = $self->initialize($class); + my $meta = Class::MOP::Class->initialize($class); return $meta->get_attribute($attr_name) if $meta->has_attribute($attr_name); } @@ -757,7 +757,7 @@ sub find_attribute_by_name { sub get_all_attributes { my $self = shift; - my %attrs = map { %{ $self->initialize($_)->_attribute_map } } + my %attrs = map { %{ Class::MOP::Class->initialize($_)->_attribute_map } } reverse $self->linearized_isa; return values %attrs; } @@ -846,7 +846,7 @@ sub class_precedence_list { return ( $name, map { - $self->initialize($_)->class_precedence_list() + Class::MOP::Class->initialize($_)->class_precedence_list() } $self->superclasses() ); } @@ -935,7 +935,7 @@ sub find_method_by_name { (defined $method_name && length $method_name) || confess "You must define a method name to find"; foreach my $class ($self->linearized_isa) { - my $method = $self->initialize($class)->get_method($method_name); + my $method = Class::MOP::Class->initialize($class)->get_method($method_name); return $method if defined $method; } return; @@ -946,7 +946,7 @@ sub get_all_methods { my %methods; for my $class ( reverse $self->linearized_isa ) { - my $meta = $self->initialize($class); + my $meta = Class::MOP::Class->initialize($class); $methods{$_} = $meta->get_method($_) for $meta->get_method_list; @@ -958,7 +958,7 @@ sub get_all_methods { sub get_all_method_names { my $self = shift; my %uniq; - return grep { !$uniq{$_}++ } map { $self->initialize($_)->get_method_list } $self->linearized_isa; + return grep { !$uniq{$_}++ } map { Class::MOP::Class->initialize($_)->get_method_list } $self->linearized_isa; } sub find_all_methods_by_name { @@ -968,7 +968,7 @@ sub find_all_methods_by_name { my @methods; foreach my $class ($self->linearized_isa) { # fetch the meta-class ... - my $meta = $self->initialize($class); + my $meta = Class::MOP::Class->initialize($class); push @methods => { name => $method_name, class => $class, @@ -985,7 +985,7 @@ sub find_next_method_by_name { my @cpl = $self->linearized_isa; shift @cpl; # discard ourselves foreach my $class (@cpl) { - my $method = $self->initialize($class)->get_method($method_name); + my $method = Class::MOP::Class->initialize($class)->get_method($method_name); return $method if defined $method; } return;