From: Yuval Kogman Date: Thu, 14 Aug 2008 15:05:21 +0000 (+0000) Subject: Class::MOP::Package->initialize now checks Class::MOP::get_metaclass_by_name for... X-Git-Tag: 0_64_01~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=188c15b9235ea68ed2d9e0ff955aff9eb6e5e62f;p=gitmo%2FClass-MOP.git Class::MOP::Package->initialize now checks Class::MOP::get_metaclass_by_name for a singleton --- diff --git a/lib/Class/MOP/Package.pm b/lib/Class/MOP/Package.pm index 5b42565..b54dbc0 100644 --- a/lib/Class/MOP/Package.pm +++ b/lib/Class/MOP/Package.pm @@ -19,7 +19,8 @@ sub initialize { my $package_name = shift; # we hand-construct the class # until we can bootstrap it - $class->_new({ + return Class::MOP::get_metaclass_by_name($package_name) || + $class->_new({ 'package' => $package_name, }); }