From: gfx Date: Fri, 2 Oct 2009 10:59:13 +0000 (+0900) Subject: Mouse::Meta::Class and Mouse::Meta::Role are now extensible by extends() X-Git-Tag: 0.37_02~31 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9009aca113962c65c836364c6d7d2e7e382bd888;p=gitmo%2FMouse.git Mouse::Meta::Class and Mouse::Meta::Role are now extensible by extends() --- diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index 4f811d9..5724ebf 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -27,7 +27,7 @@ sub _construct_meta { my $self = bless \%args, ref($class) || $class; if($class ne __PACKAGE__){ - $self->_initialize_object($self, \%args); + $self->meta->_initialize_object($self, \%args); } return $self; } diff --git a/lib/Mouse/Meta/Role.pm b/lib/Mouse/Meta/Role.pm index ec08a5b..5d1c57f 100644 --- a/lib/Mouse/Meta/Role.pm +++ b/lib/Mouse/Meta/Role.pm @@ -18,10 +18,12 @@ sub _construct_meta { $args{required_methods} ||= []; $args{roles} ||= []; -# return Mouse::Meta::Class->initialize($class)->new_object(%args) -# if $class ne __PACKAGE__; + my $self = bless \%args, ref($class) || $class; + if($class ne __PACKAGE__){ + $self->meta->_initialize_object($self, \%args); + } - return bless \%args, ref($class) || $class; + return $self; } sub create_anon_role{