my %METAS;
-# because Mouse doesn't introspect existing classes, we're forced to
-# only pay attention to other Mouse classes
-sub _metaclass_cache {
+sub _metaclass_cache { # DEPRECATED
my($class, $name) = @_;
return $METAS{$name};
}
# add_attribute is an abstract method
-sub get_attribute_map {
+sub get_attribute_map { # DEPRECATED
Carp::cluck('get_attribute_map() has been deprecated');
return $_[0]->{attributes};
}
return if !$serial_id;
- @{$self->{superclasses}} = (); # clear @ISA
- %{$self->namespace} = (); # clear the stash
+ # @ISA is a magical variable, so we clear it manually.
+ @{$self->{superclasses}} = () if exists $self->{superclasses};
+
+ # Then, clear the symbol table hash
+ %{$self->namespace} = ();
my $name = $self->name;
delete $METAS{$name};
- $name =~ s/::\d+$//;
+ $name =~ s/ $serial_id \z//xms;
no strict 'refs';
-
delete ${$name}{ $serial_id . '::' };
return;