actually, don't just call random ->does methods we don't control
Jesse Luehrs [Wed, 20 Jul 2011 14:49:25 +0000 (09:49 -0500)]
lib/Moose/Util.pm

index da44827..63a4da5 100644 (file)
@@ -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);
     }