From: Shawn M Moore Date: Sat, 28 Mar 2009 20:02:04 +0000 (-0400) Subject: Use class_of in Immutable X-Git-Tag: 0.80~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e473d0c6ec8f263e033140df7f17e5e1c78cedda;p=gitmo%2FClass-MOP.git Use class_of in Immutable --- diff --git a/lib/Class/MOP/Immutable.pm b/lib/Class/MOP/Immutable.pm index b6a0737..5f90189 100644 --- a/lib/Class/MOP/Immutable.pm +++ b/lib/Class/MOP/Immutable.pm @@ -169,7 +169,7 @@ my %DEFAULT_METHODS = ( # that has been made immutable and for that we need # to dig a bit ... if ($self->isa('Class::MOP::Class')) { - return $self->{'___original_class'}->meta; + return Class::MOP::class_of($self->{'___original_class'}); } else { return $self; @@ -184,7 +184,7 @@ sub _create_methods_for_immutable_metaclass { my $self = shift; my $metaclass = $self->metaclass; - my $meta = $metaclass->meta; + my $meta = Class::MOP::class_of($metaclass); return { %DEFAULT_METHODS, @@ -200,7 +200,7 @@ sub _create_methods_for_immutable_metaclass { sub _make_read_only_methods { my $self = shift; - my $metameta = $self->metaclass->meta; + my $metameta = Class::MOP::class_of($self->metaclass); my %methods; foreach my $read_only_method ( @{ $self->options->{read_only} } ) { @@ -238,7 +238,7 @@ sub _make_memoized_methods { my %methods; - my $metameta = $self->metaclass->meta; + my $metameta = Class::MOP::class_of($self->metaclass); my $memoized_methods = $self->options->{memoize}; foreach my $method_name ( keys %{$memoized_methods} ) { @@ -279,7 +279,7 @@ sub _make_wrapped_methods { my $wrapped_methods = $self->options->{wrapped}; - my $metameta = $self->metaclass->meta; + my $metameta = Class::MOP::class_of($self->metaclass); foreach my $method_name ( keys %{$wrapped_methods} ) { my $method = $metameta->find_method_by_name($method_name);