From: gfx Date: Wed, 19 Aug 2009 09:11:33 +0000 (+0900) Subject: Revert "Remove subname() in add_method(). Now add_package_symbol() does it in a smart... X-Git-Tag: 0.92_01~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6eefe0df62601d4467dd0822acaa4afaf01ea698;p=gitmo%2FClass-MOP.git Revert "Remove subname() in add_method(). Now add_package_symbol() does it in a smart way." This reverts commit d6d832874639934e7faa18e6ecb70a2a821c3b21. Conflicts: lib/Class/MOP/Module.pm --- diff --git a/lib/Class/MOP/Package.pm b/lib/Class/MOP/Package.pm index 47767c5..92463aa 100644 --- a/lib/Class/MOP/Package.pm +++ b/lib/Class/MOP/Package.pm @@ -330,6 +330,14 @@ sub add_method { $body = $method; } + + my ( $current_package, $current_name ) = Class::MOP::get_code_info($body); + + if ( !defined $current_name || $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 }, $body,