requires 'Sub::Exporter' => '0.972';
requires 'Task::Weaken' => '0';
requires 'Data::OptList' => '0';
+requires 'Sub::Name' => '0';
test_requires 'Test::More' => '0.77';
test_requires 'Test::Exception' => '0.21';
use List::MoreUtils qw( first_index uniq );
use Moose::Util::MetaRole;
use Sub::Exporter;
-
+use Sub::Name qw(subname);
my %EXPORT_SPEC;
my $wrapper = $self->_make_wrapper($caller, $sub, $fq_name);
- my $sub = Class::MOP::subname($fq_name => $wrapper);
+ my $sub = subname($fq_name => $wrapper);
$export_recorder->{$sub} = 1;
use Scalar::Util 'blessed';
use Carp 'confess';
+use Sub::Name 'subname';
our $VERSION = '0.76';
$VERSION = eval $VERSION;
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)
+ subname($full_method_name => $body)
);
$self->update_package_cache_flag; # still valid, since we just added the method to the map, and if it was invalid before that then get_method_map updated it
fallback => 1;
use Scalar::Util qw(blessed refaddr);
+use Sub::Name qw(subname);
use base qw(Class::MOP::Object);
if ( $check == $null_constraint ) {
return $optimized_parent;
} else {
- return Class::MOP::subname($self->name, sub {
+ return subname($self->name, sub {
return undef unless $optimized_parent->($_[0]);
my (@args) = @_;
local $_ = $args[0];
# general case, check all the constraints, from the first parent to ourselves
my @checks = @parents;
push @checks, $check if $check != $null_constraint;
- return Class::MOP::subname($self->name => sub {
+ return subname($self->name => sub {
my (@args) = @_;
local $_ = $args[0];
foreach my $check (@checks) {
return $check if $check == $null_constraint; # Item, Any
- return Class::MOP::subname($self->name => sub {
+ return subname($self->name => sub {
my (@args) = @_;
local $_ = $args[0];
$check->(@args);