bye bye Class::C3. for good.
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Component.pm
index aac0b64..876f682 100644 (file)
@@ -4,7 +4,6 @@ use Moose;
 use MooseX::Adopt::Class::Accessor::Fast;
 use Catalyst::Utils;
 
-
 with 'MooseX::Emulate::Class::Accessor::Fast';
 with 'Catalyst::ClassData';
 
@@ -55,37 +54,23 @@ component loader with config() support and a process() method placeholder.
 __PACKAGE__->mk_classdata($_) for qw/_config _plugins/;
 
 around new => sub {
-    my $orig = shift;
-    my ( $self, $c ) = @_;
+    my ( $orig, $self) = @_;
 
     # Temporary fix, some components does not pass context to constructor
     my $arguments = ( ref( $_[-1] ) eq 'HASH' ) ? $_[-1] : {};
 
     my $args =  $self->merge_config_hashes( $self->config, $arguments );
-    return $self->$orig( $args );
+    $self->$orig( $args );
 };
 
+no Moose;
+
 sub COMPONENT {
     my ( $self, $c ) = @_;
 
     # Temporary fix, some components does not pass context to constructor
     my $arguments = ( ref( $_[-1] ) eq 'HASH' ) ? $_[-1] : {};
-    $self->new($c, $arguments);
-
-#     if ( my $new = $self->NEXT::COMPONENT( $c, $arguments ) ) {
-#         return $new;
-#     }
-#     else {
-#         if ( my $new = $self->new( $c, $arguments ) ) {
-#             return $new;
-#         }
-#         else {
-#             my $class = ref $self || $self;
-#             my $new   = $self->merge_config_hashes(
-#                 $self->config, $arguments );
-#             return bless $new, $class;
-#         }
-#     }
+    return $self->new($c, $arguments);
 }
 
 sub config {