From: Matt S Trout Date: Fri, 3 Aug 2012 16:44:08 +0000 (+0000) Subject: honour BUILDARGS when calling $meta->new_object on behalf of Moose X-Git-Tag: v1.000002~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eea41fb2c9a6cae25d22dfdc425220ba20532b14;p=gitmo%2FMoo.git honour BUILDARGS when calling $meta->new_object on behalf of Moose --- diff --git a/Changes b/Changes index 11a9588..afb921a 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,4 @@ + - honour BUILDARGS when calling $meta->new_object on behalf of Moose - throw an error on invalid builder (RT#78479) - require D::GD 0.07 to avoid prototype mismatch errors - fix stupid typo in new Sub::Quote section diff --git a/lib/Moo.pm b/lib/Moo.pm index 43f826d..545db75 100644 --- a/lib/Moo.pm +++ b/lib/Moo.pm @@ -162,7 +162,7 @@ sub _constructor_maker_for { .' '.$class.'->_constructor_maker_for($class,'.perlstring($target).');'."\n" .' return $class->new(@_)'.";\n" .' } elsif ($INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)) {'."\n" - .' return $meta->new_object(@_);'."\n" + .' return $meta->new_object($class->BUILDARGS(@_));'."\n" .' }'."\n" ), )