my ($pkg, $name) = Class::MOP::get_code_info($code);
- if ($pkg->can('meta')
- # NOTE:
- # we don't know what ->meta we are calling
- # here, so we need to be careful cause it
- # just might blow up at us, or just complain
- # loudly (in the case of Curses.pm) so we
- # just be a little overly cautious here.
- # - SL
- && eval { no warnings; blessed($pkg->meta) }
- && $pkg->meta->isa('Moose::Meta::Role')) {
- #my $role = $pkg->meta->name;
- #next unless $self->does_role($role);
- }
- else {
-
- # NOTE:
- # in 5.10 constant.pm the constants show up
- # as being in the right package, but in pre-5.10
- # they show up as constant::__ANON__ so we
- # make an exception here to be sure that things
- # work as expected in both.
- # - SL
- unless ($pkg eq 'constant' && $name eq '__ANON__') {
- next if ($pkg || '') ne $class_name ||
- (($name || '') ne '__ANON__' && ($pkg || '') ne $class_name);
- }
-
+ # NOTE:
+ # in 5.10 constant.pm the constants show up
+ # as being in the right package, but in pre-5.10
+ # they show up as constant::__ANON__ so we
+ # make an exception here to be sure that things
+ # work as expected in both.
+ # - SL
+ unless ( $pkg eq 'constant' && $name eq '__ANON__' ) {
+ next
+ if ( $pkg || '' ) ne $class_name
+ || ( ( $name || '' ) ne '__ANON__'
+ && ( $pkg || '' ) ne $class_name
+ );
}
$map->{$symbol} = $method_metaclass->wrap(