From: Dave Rolsky Date: Tue, 7 Jul 2009 20:45:54 +0000 (-0500) Subject: Revert "really try to make method modifier names unique" X-Git-Tag: 0.90~27 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dca0c6172ee6967b99f95e24dc1afe1e18fb0b5e;p=gitmo%2FClass-MOP.git Revert "really try to make method modifier names unique" This reverts commit 4884b0cd5dd83114eba79aa05372cb0d52309f80. --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index 9f2f06f..24234b8 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -666,14 +666,13 @@ sub add_method { return $method; }; - my $counter = 0; sub add_before_method_modifier { my ($self, $method_name, $method_modifier) = @_; (defined $method_name && $method_name) || confess "You must pass in a method name"; my $method = $fetch_and_prepare_method->($self, $method_name); $method->add_before_modifier( - subname(':before-' . $counter++ . q{-} . $method_name => $method_modifier) + subname(':before-' . $method_name => $method_modifier) ); } @@ -683,7 +682,7 @@ sub add_method { || confess "You must pass in a method name"; my $method = $fetch_and_prepare_method->($self, $method_name); $method->add_after_modifier( - subname(':after-' . $counter++ . q{-} . $method_name => $method_modifier) + subname(':after-' . $method_name => $method_modifier) ); } @@ -693,7 +692,7 @@ sub add_method { || confess "You must pass in a method name"; my $method = $fetch_and_prepare_method->($self, $method_name); $method->add_around_modifier( - subname(':around-' . $counter++ . q{-} . $method_name => $method_modifier) + subname(':around-' . $method_name => $method_modifier) ); } diff --git a/t/031_method_modifiers.t b/t/031_method_modifiers.t index f6f6dcd..3b04428 100644 --- a/t/031_method_modifiers.t +++ b/t/031_method_modifiers.t @@ -225,6 +225,6 @@ use Class::MOP::Method; } { - is( Foo->orig1, 'Class::MOP::Class:::around-18-orig1', 'each modifier gets a unique name' ); - is( Foo->orig2, 'Class::MOP::Class:::around-19-orig2', 'each modifier gets a unique name' ); + is( Foo->orig1, 'Class::MOP::Class:::around-orig1', 'each modifier gets a unique name' ); + is( Foo->orig2, 'Class::MOP::Class:::around-orig2', 'each modifier gets a unique name' ); }