From: Chris Prather Date: Thu, 30 Apr 2009 04:13:47 +0000 (-0400) Subject: remove Class::MOP::subname and Class::MOP::in_global_destruction X-Git-Tag: 0.84~27 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f352997dd8e091b0625985811052c25192587ec7;p=gitmo%2FClass-MOP.git remove Class::MOP::subname and Class::MOP::in_global_destruction --- diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index 4d8e8fb..fdb397f 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -9,9 +9,7 @@ use 5.008; use MRO::Compat; use Carp 'confess'; -use Devel::GlobalDestruction qw( in_global_destruction ); use Scalar::Util 'weaken', 'reftype', 'blessed'; -use Sub::Name qw( subname ); use Class::MOP::Class; use Class::MOP::Attribute; @@ -940,19 +938,6 @@ This will return the metaclass of the given instance or class name. Even if the class lacks a metaclass, no metaclass will be initialized and C will be returned. -=item B - -Will return true if we're currently in Global Destruction. This is currently -passed through from L's -function of the same name - -=item B - -Allows you to provide an informative name to a subroutine for things like Carp -and caller. This allows easier debugging of closures as well as anonymous -subroutines. Currently this is passed through from L's -function of the same name. - =item B B diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index a2867c1..f67bedf 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -12,6 +12,7 @@ use Class::MOP::Class::Immutable::Class::MOP::Class; use Carp 'confess'; use Scalar::Util 'blessed', 'weaken'; +use Sub::Name (); our $VERSION = '0.83'; $VERSION = eval $VERSION; @@ -246,7 +247,7 @@ sub _check_metaclass_compatibility { sub DESTROY { my $self = shift; - return if Class::MOP::in_global_destruction(); # it'll happen soon anyway and this just makes things more complicated + return if Devel::GlobalDestruction::in_global_destruction(); # it'll happen soon anyway and this just makes things more complicated no warnings 'uninitialized'; return unless $self->name =~ /^$ANON_CLASS_PREFIX/; @@ -610,7 +611,7 @@ sub add_method { my $full_method_name = ($self->name . '::' . $method_name); $self->add_package_symbol( { sigil => '&', type => 'CODE', name => $method_name }, - Class::MOP::subname($full_method_name => $body) + Sub::Name::subname($full_method_name => $body) ); } @@ -647,7 +648,7 @@ sub add_method { || confess "You must pass in a method name"; my $method = $fetch_and_prepare_method->($self, $method_name); $method->add_before_modifier( - Class::MOP::subname(':before' => $method_modifier) + Sub::Name::subname(':before' => $method_modifier) ); } @@ -657,7 +658,7 @@ sub add_method { || confess "You must pass in a method name"; my $method = $fetch_and_prepare_method->($self, $method_name); $method->add_after_modifier( - Class::MOP::subname(':after' => $method_modifier) + Sub::Name::subname(':after' => $method_modifier) ); } @@ -667,7 +668,7 @@ sub add_method { || confess "You must pass in a method name"; my $method = $fetch_and_prepare_method->($self, $method_name); $method->add_around_modifier( - Class::MOP::subname(':around' => $method_modifier) + Sub::Name::subname(':around' => $method_modifier) ); }