From: Jesse Luehrs Date: Wed, 20 Jul 2011 14:49:25 +0000 (-0500) Subject: actually, don't just call random ->does methods we don't control X-Git-Tag: 2.0201~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ad9792b20dfaff11752e85317588c342b421d183;p=gitmo%2FMoose.git actually, don't just call random ->does methods we don't control --- diff --git a/lib/Moose/Util.pm b/lib/Moose/Util.pm index da44827..63a4da5 100644 --- a/lib/Moose/Util.pm +++ b/lib/Moose/Util.pm @@ -44,7 +44,7 @@ sub find_meta { Class::MOP::class_of(@_) } sub does_role { my ($class_or_obj, $role) = @_; - if (try { $class_or_obj->can('does') }) { + if (try { $class_or_obj->isa('Moose::Object') }) { return $class_or_obj->does($role); }