[Catalyst-commits] r10613 - in Catalyst-Runtime/5.80/trunk: .
lib/Catalyst
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Mon Jun 22 16:37:26 GMT 2009
Author: t0m
Date: 2009-06-22 16:37:26 +0000 (Mon, 22 Jun 2009)
New Revision: 10613
Modified:
Catalyst-Runtime/5.80/trunk/Changes
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component.pm
Log:
Use merge_hashes rather than dclone
Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes 2009-06-22 16:31:09 UTC (rev 10612)
+++ Catalyst-Runtime/5.80/trunk/Changes 2009-06-22 16:37:26 UTC (rev 10613)
@@ -6,6 +6,10 @@
applications.
- Remove use of Test::MockObject as it doesn't install from CPAN
in some environments.
+ - Remove use of dclone to deep copy configs and replace with
+ Catalyst::Utils::merge_hashes which has the same effect, of
+ ensuring child classes don't inherit their parent's config,
+ except works correctly with closures.
5.80005 2009-06-06 14:40:00
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component.pm 2009-06-22 16:31:09 UTC (rev 10612)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component.pm 2009-06-22 16:37:26 UTC (rev 10613)
@@ -8,7 +8,6 @@
use MRO::Compat;
use mro 'c3';
use Scalar::Util 'blessed';
-use Storable 'dclone';
use namespace::clean -except => 'meta';
with 'MooseX::Emulate::Class::Accessor::Fast';
@@ -117,7 +116,9 @@
my $class = blessed($self) || $self;
my $meta = Class::MOP::get_metaclass_by_name($class);
unless ($meta->has_package_symbol('$_config')) {
- $self->_config( dclone $config );
+ # Call merge_hashes to ensure we deep copy the parent
+ # config onto the subclass
+ $self->_config( Catalyst::Utils::merge_hashes($config, {}) );
}
}
return $self->_config;
More information about the Catalyst-commits
mailing list