if ( $args eq '@_' and ( !$buildargs or $buildargs->body == \&Moose::Object::BUILDARGS ) ) {
return join("\n",
'do {',
+ 'no warnings "uninitialized";',
'confess "Single parameters to new() must be a HASH ref"',
' if scalar @_ == 1 && defined $_[0] && ref($_[0]) ne q{HASH};',
'(scalar @_ == 1) ? {%{$_[0]}} : {@_};',
if (scalar @_ == 1) {
if (defined $_[0]) {
+ no warnings 'uninitialized';
(ref($_[0]) eq 'HASH')
|| confess "Single parameters to new() must be a HASH ref";
return {%{$_[0]}};
+ } else {
+ return {}; # FIXME this is compat behavior, but is it correct?
}
-
- return {}; # FIXME this is compat behavior, but is it correct?
} else {
return {@_};
}