From: Fuji, Goro Date: Sat, 25 Sep 2010 06:56:32 +0000 (+0900) Subject: Allow $obj->new in pure Perl X-Git-Tag: 0.72~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c83feefa58c2e80f31e5c3b08e16cabe04cfdb0c;p=gitmo%2FMouse.git Allow $obj->new in pure Perl --- diff --git a/lib/Mouse/PurePerl.pm b/lib/Mouse/PurePerl.pm index 23b89a9..fb1909f 100644 --- a/lib/Mouse/PurePerl.pm +++ b/lib/Mouse/PurePerl.pm @@ -729,13 +729,8 @@ sub BUILDARGS { sub new { my $class = shift; - - $class->meta->throw_error('Cannot call new() on an instance') if ref $class; - - my $args = $class->BUILDARGS(@_); - - my $meta = Mouse::Meta::Class->initialize($class); - return $meta->new_object($args); + my $args = $class->BUILDARGS(@_); + return $class->meta->new_object($args); } sub DESTROY {