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;
Even if the class lacks a metaclass, no metaclass will be initialized
and C<undef> will be returned.
-=item B<Class::MOP::in_global_destruction()>
-
-Will return true if we're currently in Global Destruction. This is currently
-passed through from L<Devel::GlobalDestruction|Devel::GlobalDestruction>'s
-function of the same name
-
-=item B<Class::MOP::subname>
-
-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<Sub::Name|Sub::Name>'s
-function of the same name.
-
=item B<Class::MOP::check_package_cache_flag($pkg)>
B<NOTE: DO NOT USE THIS FUNCTION, IT IS FOR INTERNAL USE ONLY!>
use Carp 'confess';
use Scalar::Util 'blessed', 'weaken';
+use Sub::Name ();
our $VERSION = '0.83';
$VERSION = eval $VERSION;
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/;
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)
);
}
|| 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)
);
}
|| 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)
);
}
|| 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)
);
}