From: Shawn M Moore Date: Thu, 28 May 2009 16:12:45 +0000 (-0400) Subject: Add a hook for _superclasses_updated X-Git-Tag: 0.85~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b53f14fa05a2b3573aab15a9abdc7a5069cd4164;p=gitmo%2FClass-MOP.git Add a hook for _superclasses_updated --- diff --git a/Changes b/Changes index 7dfafbc..e185727 100644 --- a/Changes +++ b/Changes @@ -16,6 +16,7 @@ Revision history for Perl extension Class-MOP. - Tests for subclasses and direct_subclasses (Sartak) - subname is no longer used unconditionally in add_method, but only if the code reference's name is '__ANON__' (nothingmuch) + - Add a hook for _superclasses_updated (Sartak) 0.84 Tue, May 12, 2009 * Makefile.PL diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index bdc2793..a21b69b 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -517,11 +517,16 @@ sub superclasses { # we don't know about $self->_check_metaclass_compatibility(); - $self->update_meta_instance_dependencies(); + $self->_superclasses_updated(); } @{$self->get_package_symbol($var_spec)}; } +sub _superclasses_updated { + my $self = shift; + $self->update_meta_instance_dependencies(); +} + sub subclasses { my $self = shift; my $super_class = $self->name; diff --git a/t/010_self_introspection.t b/t/010_self_introspection.t index d4486f9..fbc2e23 100644 --- a/t/010_self_introspection.t +++ b/t/010_self_introspection.t @@ -1,7 +1,7 @@ use strict; use warnings; -use Test::More tests => 296; +use Test::More tests => 298; use Test::Exception; use Class::MOP; @@ -73,7 +73,7 @@ my @class_mop_class_methods = qw( attribute_metaclass method_metaclass wrapped_method_metaclass superclasses subclasses direct_subclasses class_precedence_list - linearized_isa + linearized_isa _superclasses_updated has_method get_method add_method remove_method alias_method wrap_method_body get_method_list get_method_map get_all_method_names get_all_methods compute_all_applicable_methods