[Catalyst-commits] r13899 - Catalyst-Runtime/5.80/trunk/lib/Catalyst
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Mon Jan 3 19:59:37 GMT 2011
Author: rafl
Date: 2011-01-03 19:59:37 +0000 (Mon, 03 Jan 2011)
New Revision: 13899
Modified:
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component.pm
Log:
Stop relying on Package::Stash PP bugs
We want to know if $MyApp::_config contains something like a valid
configuration, not if the package symbol exists.
The pure-perl version Package::Stash has always been buggy in assuming that a
scalar symbol containing undef is a symbol that doesn't exist. This is to work
around the fact that getting the SCALAR slot from a glob in pure perl
autovivifies the scalar to undef. Package::Stash::XS doesn't have that
limitation and is used transparently by Package::Stash if it's installed. That
exposed this bug in our code.
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component.pm 2010-12-26 09:44:24 UTC (rev 13898)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component.pm 2011-01-03 19:59:37 UTC (rev 13899)
@@ -127,7 +127,7 @@
# TODO maybe this should be a ClassData option?
my $class = blessed($self) || $self;
my $meta = Class::MOP::get_metaclass_by_name($class);
- unless ($meta->has_package_symbol('$_config')) {
+ unless (${ $meta->get_package_symbol('$_config') }) {
# Call merge_hashes to ensure we deep copy the parent
# config onto the subclass
$self->_config( Catalyst::Utils::merge_hashes($config, {}) );
More information about the Catalyst-commits
mailing list