From: gfx Date: Mon, 17 Aug 2009 04:34:48 +0000 (+0900) Subject: Remove subname() in add_method(). Now add_package_symbol() does it in a smart way. X-Git-Tag: 0.92_01~23 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d6d832874639934e7faa18e6ecb70a2a821c3b21;p=gitmo%2FClass-MOP.git Remove subname() in add_method(). Now add_package_symbol() does it in a smart way. --- diff --git a/lib/Class/MOP/Module.pm b/lib/Class/MOP/Module.pm index e7ce4d1..ae89002 100644 --- a/lib/Class/MOP/Module.pm +++ b/lib/Class/MOP/Module.pm @@ -61,8 +61,8 @@ sub _instantiate_module { Class::MOP::_is_valid_class_name($package_name) || confess "creation of $package_name failed: invalid package name"; - $self->add_package_symbol('$VERSION', \$version); - $self->add_package_symbol('$AUTHORITY', \$authority); + ${ $self->get_package_symbol('$VERSION', create => 1) } = $version; + ${ $self->get_package_symbol('$AUTHORITY', create => 1) } = $authority; return; } diff --git a/lib/Class/MOP/Package.pm b/lib/Class/MOP/Package.pm index f2c8e44..c69ab02 100644 --- a/lib/Class/MOP/Package.pm +++ b/lib/Class/MOP/Package.pm @@ -256,14 +256,6 @@ 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,