}
if ($attr->has_trigger) {
- $code .= "\$attrs[$index]->{trigger}->( \$instance, \$value, \$attrs[$index] );\n";
+ $code .= "\$attrs[$index]->{trigger}->( \$instance, \$value );\n";
}
$code .= "\n} else {\n";
my $self = shift;
my $meta = shift;
- if ($meta->name->can('BUILDARGS') != Mouse::Object->can('BUILDARGS')) {
+ if ($meta->name->can('BUILDARGS') && $meta->name->can('BUILDARGS') != Mouse::Object->can('BUILDARGS')) {
return '$class->BUILDARGS(@_)';
}
return <<'...';
do {
if ( scalar @_ == 1 ) {
- if ( defined $_[0] ) {
- ( ref( $_[0] ) eq 'HASH' )
+ ( ref( $_[0] ) eq 'HASH' )
|| Carp::confess "Single parameters to new() must be a HASH ref";
- +{ %{ $_[0] } };
- }
- else {
- +{};
- }
+ +{ %{ $_[0] } };
}
else {
+{@_};