This makes no fucking sense, but we used to do this, so changing it now may
break existing (boneheaded) code.
# Constants will show up as some sort of reference in the namespace hash
# ref.
return grep {
- ! ref $namespace->{$_}
- && *{ $namespace->{$_} }{CODE}
+ ( ref $namespace->{$_} || *{ $namespace->{$_} }{CODE} )
&& $self->has_method($_)
}
keys %{$namespace};
my $namespace = $self->namespace;
return map { $self->get_method($_) }
- grep { ! ref $namespace->{$_} && *{ $namespace->{$_} }{CODE} }
+ grep { ref $namespace->{$_} || *{ $namespace->{$_} }{CODE} }
keys %{$namespace};
}
is_deeply(
[ sort $HC->get_method_list ],
- [qw( quux thing )],
+ [qw( BAR BAZ FOO quux thing )],
'get_method_list handles constants properly'
);
is_deeply(
[ sort map { $_->name } $HC->_get_local_methods ],
- [qw( quux thing )],
+ [qw( BAR BAZ FOO quux thing )],
'_get_local_methods handles constants properly'
);