* Class::MOP::Class
- Add direct_subclasses method (Sartak)
- Tests for subclasses and direct_subclasses (Sartak)
+ - subname is no longer used unconditionally in add_method, but only if
+ the code reference's name is '__ANON__' (nothingmuch)
0.84 Tue, May 12, 2009
* Makefile.PL
# method. This is hackier, but quicker too.
$self->{methods}{$method_name} = $method;
- my $full_method_name = ($self->name . '::' . $method_name);
+ my ( $current_package, $current_name ) = Class::MOP::get_code_info($body);
+
+ if ( $current_name eq '__ANON__' ) {
+ my $full_method_name = ($self->name . '::' . $method_name);
+ subname($full_method_name => $body);
+ }
+
$self->add_package_symbol(
- { sigil => '&', type => 'CODE', name => $method_name },
- subname($full_method_name => $body)
+ { sigil => '&', type => 'CODE', name => $method_name },
+ $body,
);
}