From: Dave Rolsky Date: Wed, 3 Dec 2008 00:23:30 +0000 (+0000) Subject: ->wrap is documented as a constructor, so it should expect a class name as the first... X-Git-Tag: 0.71_01~28 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c2829bbc6f2b88e33a5854e267cca9374e611957;p=gitmo%2FClass-MOP.git ->wrap is documented as a constructor, so it should expect a class name as the first argument, not an object. --- diff --git a/lib/Class/MOP/Method.pm b/lib/Class/MOP/Method.pm index 4581498..a619c2b 100644 --- a/lib/Class/MOP/Method.pm +++ b/lib/Class/MOP/Method.pm @@ -43,7 +43,7 @@ sub wrap { ($params{package_name} && $params{name}) || confess "You must supply the package_name and name parameters $UPGRADE_ERROR_TEXT"; - my $self = (ref($class) || $class)->_new(\%params); + my $self = $class->_new(\%params); weaken($self->{associated_metaclass}) if $self->{associated_metaclass};