[Catalyst-commits] r10361 - Catalyst-Runtime/5.80/branches/component-tweaks/lib/Catalyst

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Fri May 29 11:40:29 GMT 2009


Author: caelum
Date: 2009-05-29 11:40:29 +0000 (Fri, 29 May 2009)
New Revision: 10361

Modified:
   Catalyst-Runtime/5.80/branches/component-tweaks/lib/Catalyst/Component.pm
Log:
with blessed  too

Modified: Catalyst-Runtime/5.80/branches/component-tweaks/lib/Catalyst/Component.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/component-tweaks/lib/Catalyst/Component.pm	2009-05-29 11:34:29 UTC (rev 10360)
+++ Catalyst-Runtime/5.80/branches/component-tweaks/lib/Catalyst/Component.pm	2009-05-29 11:40:29 UTC (rev 10361)
@@ -9,6 +9,7 @@
 use mro 'c3';
 use Storable 'dclone';
 use Carp;
+use Scalar::Util 'blessed';
 use namespace::clean -except => 'meta';
 
 with 'MooseX::Emulate::Class::Accessor::Fast';
@@ -66,7 +67,8 @@
     if (@_ == 1 && ref($_[0]) eq 'HASH') {
         return $_[0];
     } elsif (@_ == 2) { # is it ($app, $args) or foo => 'bar' ?
-        if (Class::MOP::is_class_loaded($_[0]) && $_[0]->isa('Catalyst')) {
+        if (blessed($_[0]) ||
+           (Class::MOP::is_class_loaded($_[0]) && $_[0]->isa('Catalyst'))) {
             return $_[1];
         } else {
             return +{ @_ };




More information about the Catalyst-commits mailing list