X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;fp=lib%2FCatalyst.pm;h=7556e34f54841a753350709520e9b934cfc26778;hp=b60196207d6739bb3382abed49ff634195d362f8;hb=d2598ac82e8508f4d6da90ec60a1ed60840c2016;hpb=829b22f766b0b1d1a09a6ce152abe48ad9bde5ec diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index b601962..7556e34 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -2215,10 +2215,11 @@ sub setup_component { my $suffix = Catalyst::Utils::class2classsuffix( $component ); my $config = $class->config->{ $suffix } || {}; - $config->{_component_name} = $component; # Put this in args here, rather - # than in COMPONENT as there - # are lots of custom COMPONENT - # methods.. + # Stash _component_name in the config here, so that custom COMPONENT + # methods also pass it. local to avoid pointlessly shitting in config + # for the debug screen, as $component is already the key name. + local $config->{_component_name} = $component; + my $instance = eval { $component->COMPONENT( $class, $config ); }; if ( my $error = $@ ) {