my $sigdie = $OrigSigDie && $OrigSigDie != \&_SIGDIE
? $OrigSigDie
: sub { die $_[0] };
-
+
return $sigdie->(@_) if ref($_[0]);
-
+
my $attr_desc = _attr_desc(@$CurrentAttribute{qw(name init_arg)});
$sigdie->("$CurrentAttribute->{step} for $attr_desc failed: $_[0]");
}
_die_overwrite($into, $cl, 'a clearer')
if !$spec->{allow_overwrite} && *{_getglob("${into}::${cl}")}{CODE};
$methods{$cl} =
- quote_sub "${into}::${cl}" =>
+ quote_sub "${into}::${cl}" =>
$self->_generate_simple_clear('$_[0]', $name, $spec)."\n"
;
}
$code = "do { my \$self = shift;\n";
}
if ($isa_check) {
- $code .=
+ $code .=
" ".$self->_generate_isa_check($name, $value_store, $isa_check).";\n";
}
my $simple = $self->_generate_simple_set('$self', $name, $spec, $value_store);
$self->_generate_call_code($name, 'coerce', "${value}", $coerce)
);
}
-
+
sub generate_trigger {
my $self = shift;
$self->{captures} = {};
my $get_default = $self->_generate_get_default(
'$new', $name, $spec
);
- my $get_value =
+ my $get_value =
defined($spec->{init_arg})
? "(\n${get_indent} ${test}\n${get_indent} ? ${source}\n${get_indent} : "
.$get_default
$MAKERS{$target}{accessor} ||= do {
my $maker_class = do {
if (my $m = do {
- if (my $defer_target =
+ if (my $defer_target =
(Sub::Defer::defer_info($target->can('new'))||[])->[0]
) {
my ($pkg) = ($defer_target =~ /^(.*)::[^:]+$/);
} else {
$moo_constructor = 1; # no other constructor, make a Moo one
}
- };
+ }
($con ? ref($con) : 'Method::Generate::Constructor')
->new(
package => $target,