line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
use strict; |
3
|
2
|
|
|
2
|
|
14
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
60
|
|
4
|
2
|
|
|
2
|
|
12
|
no warnings qw( once void ); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
58
|
|
5
|
2
|
|
|
2
|
|
10
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
364
|
|
6
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
7
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
8
|
|
|
|
|
|
|
our $MITE_VERSION = "0.011000"; |
9
|
|
|
|
|
|
|
# Mite keywords |
10
|
|
|
|
|
|
|
BEGIN { |
11
|
|
|
|
|
|
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "MyTest3" ); |
12
|
2
|
|
|
2
|
|
10
|
( *after, *around, *before, *extends, *field, *has, *param, *signature_for, *with ) = do { |
13
|
2
|
|
|
|
|
4
|
no warnings 'redefine'; |
14
|
|
|
|
|
|
|
( |
15
|
2
|
|
|
2
|
|
16
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
436
|
|
16
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
17
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
18
|
0
|
|
|
|
|
0
|
sub {}, |
19
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) }, |
20
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
21
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) }, |
22
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
23
|
0
|
|
|
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
24
|
2
|
|
|
|
|
10
|
); |
25
|
0
|
|
|
|
|
0
|
}; |
26
|
2
|
|
|
|
|
414
|
|
27
|
|
|
|
|
|
|
# Mite imports |
28
|
|
|
|
|
|
|
BEGIN { |
29
|
|
|
|
|
|
|
require Scalar::Util; |
30
|
|
|
|
|
|
|
*STRICT = \&Mite::Shim::STRICT; |
31
|
|
|
|
|
|
|
*bare = \&Mite::Shim::bare; |
32
|
2
|
|
|
2
|
|
14
|
*blessed = \&Scalar::Util::blessed; |
33
|
2
|
|
|
|
|
4
|
*carp = \&Mite::Shim::carp; |
34
|
2
|
|
|
|
|
6
|
*confess = \&Mite::Shim::confess; |
35
|
2
|
|
|
|
|
4
|
*croak = \&Mite::Shim::croak; |
36
|
2
|
|
|
|
|
4
|
*false = \&Mite::Shim::false; |
37
|
2
|
|
|
|
|
2
|
*guard = \&Mite::Shim::guard; |
38
|
2
|
|
|
|
|
4
|
*lazy = \&Mite::Shim::lazy; |
39
|
2
|
|
|
|
|
4
|
*lock = \&Mite::Shim::lock; |
40
|
2
|
|
|
|
|
2
|
*ro = \&Mite::Shim::ro; |
41
|
2
|
|
|
|
|
4
|
*rw = \&Mite::Shim::rw; |
42
|
2
|
|
|
|
|
4
|
*rwp = \&Mite::Shim::rwp; |
43
|
2
|
|
|
|
|
2
|
*true = \&Mite::Shim::true; |
44
|
2
|
|
|
|
|
4
|
*unlock = \&Mite::Shim::unlock; |
45
|
2
|
|
|
|
|
2
|
}; |
46
|
2
|
|
|
|
|
4
|
|
47
|
2
|
|
|
|
|
74
|
# Gather metadata for constructor and destructor |
48
|
|
|
|
|
|
|
no strict 'refs'; |
49
|
|
|
|
|
|
|
my $class = shift; $class = ref($class) || $class; |
50
|
|
|
|
|
|
|
my $linear_isa = mro::get_linear_isa( $class ); |
51
|
|
|
|
|
|
|
return { |
52
|
2
|
|
|
2
|
|
10
|
BUILD => [ |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1296
|
|
53
|
2
|
|
33
|
2
|
|
4
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
2
|
|
|
|
|
16
|
|
54
|
2
|
|
|
|
|
12
|
map { "$_\::BUILD" } reverse @$linear_isa |
55
|
|
|
|
|
|
|
], |
56
|
|
|
|
|
|
|
DEMOLISH => [ |
57
|
4
|
50
|
|
|
|
4
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
4
|
|
|
|
|
24
|
|
|
0
|
|
|
|
|
0
|
|
58
|
4
|
|
|
|
|
12
|
map { "$_\::DEMOLISH" } @$linear_isa |
59
|
|
|
|
|
|
|
], |
60
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
61
|
4
|
50
|
|
|
|
16
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
|
4
|
|
|
|
|
82
|
|
|
0
|
|
|
|
|
0
|
|
62
|
2
|
|
|
|
|
8
|
}; |
|
4
|
|
|
|
|
8
|
|
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
67
|
|
|
|
|
|
|
my $class = ref($_[0]) ? ref(shift) : shift; |
68
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
69
|
|
|
|
|
|
|
my $self = bless {}, $class; |
70
|
|
|
|
|
|
|
my $args = $meta->{HAS_BUILDARGS} ? $class->BUILDARGS( @_ ) : { ( @_ == 1 ) ? %{$_[0]} : @_ }; |
71
|
|
|
|
|
|
|
my $no_build = delete $args->{__no_BUILD__}; |
72
|
2
|
50
|
|
2
|
|
5456
|
|
73
|
2
|
|
33
|
|
|
18
|
|
74
|
2
|
|
|
|
|
6
|
|
75
|
2
|
50
|
|
|
|
8
|
# Call BUILD methods |
|
0
|
50
|
|
|
|
0
|
|
76
|
2
|
|
|
|
|
4
|
$self->BUILDALL( $args ) if ( ! $no_build and @{ $meta->{BUILD} || [] } ); |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# Unrecognized parameters |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
return $self; |
81
|
2
|
50
|
33
|
|
|
10
|
} |
|
2
|
50
|
|
|
|
10
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
84
|
2
|
0
|
|
|
|
2
|
my $class = ref( $_[0] ); |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
50
|
|
|
|
0
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
6
|
|
85
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
86
|
2
|
|
|
|
|
60
|
$_->( @_ ) for @{ $meta->{BUILD} || [] }; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
90
|
|
|
|
|
|
|
my $self = shift; |
91
|
0
|
|
|
0
|
|
0
|
my $class = ref( $self ) || $self; |
92
|
0
|
|
0
|
|
|
0
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
93
|
0
|
0
|
|
|
|
0
|
my $in_global_destruction = defined ${^GLOBAL_PHASE} |
|
0
|
|
|
|
|
0
|
|
94
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
95
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
96
|
|
|
|
|
|
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
97
|
|
|
|
|
|
|
my $e = do { |
98
|
2
|
|
|
2
|
|
170
|
local ( $?, $@ ); |
99
|
2
|
|
33
|
|
|
10
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
100
|
2
|
|
33
|
|
|
8
|
$@; |
101
|
2
|
50
|
|
|
|
10
|
}; |
102
|
|
|
|
|
|
|
no warnings 'misc'; # avoid (in cleanup) warnings |
103
|
|
|
|
|
|
|
die $e if $e; # rethrow |
104
|
2
|
50
|
|
|
|
2
|
} |
|
2
|
|
|
|
|
26
|
|
105
|
0
|
|
|
|
|
0
|
return; |
106
|
0
|
|
|
|
|
0
|
} |
107
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
108
|
0
|
|
|
|
|
0
|
|
109
|
|
|
|
|
|
|
# See UNIVERSAL |
110
|
2
|
|
|
2
|
|
16
|
my ( $self, $role ) = @_; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1438
|
|
111
|
0
|
0
|
|
|
|
0
|
our %DOES; |
112
|
|
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
113
|
2
|
|
|
|
|
10
|
return 1 if $role eq __PACKAGE__; |
114
|
|
|
|
|
|
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
115
|
|
|
|
|
|
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
return $self->SUPER::DOES( $role ); |
118
|
|
|
|
|
|
|
} |
119
|
96
|
|
|
96
|
|
128
|
|
120
|
96
|
|
|
|
|
116
|
# Alias for Moose/Moo-compatibility |
121
|
96
|
50
|
|
|
|
136
|
shift->DOES( @_ ); |
122
|
96
|
50
|
|
|
|
128
|
} |
123
|
96
|
50
|
0
|
|
|
132
|
|
|
|
|
33
|
|
|
|
|
124
|
0
|
0
|
0
|
|
|
0
|
# Method signatures |
125
|
|
|
|
|
|
|
our %SIGNATURE_FOR; |
126
|
96
|
|
|
|
|
394
|
|
127
|
|
|
|
|
|
|
$SIGNATURE_FOR{"foo"} = sub { |
128
|
|
|
|
|
|
|
my $__NEXT__ = shift; |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
my ( %out, %in, %tmp, $tmp, $dtmp, @head ); |
131
|
48
|
|
|
48
|
|
5076
|
|
132
|
|
|
|
|
|
|
@_ == 2 && (ref($_[1]) eq 'HASH') |
133
|
|
|
|
|
|
|
or @_ % 2 == 1 && @_ == 5 |
134
|
|
|
|
|
|
|
or croak( "Wrong number of parameters in signature for %s: got %d, %s", "foo", scalar( @_ ), "that does not seem right" ); |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
@head = splice( @_, 0, 1 ); |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
# Parameter invocant (type: Defined) |
139
|
|
|
|
|
|
|
(defined($head[0])) |
140
|
|
|
|
|
|
|
or croak( "Type check failed in signature for foo: %s should be %s", "\$_[0]", "Defined" ); |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
%in = ( @_ == 1 and (ref($_[0]) eq 'HASH') ) ? %{ $_[0] } : @_; |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
# Parameter xxx (type: Int) |
145
|
|
|
|
|
|
|
exists( $in{"xxx"} ) |
146
|
|
|
|
|
|
|
or croak( "Failure in signature for foo: " . 'Missing required parameter: xxx' ); |
147
|
|
|
|
|
|
|
(do { my $tmp = $in{"xxx"}; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) |
148
|
|
|
|
|
|
|
or croak( "Type check failed in signature for foo: %s should be %s", "\$_{\"xxx\"}", "Int" ); |
149
|
|
|
|
|
|
|
$out{"xxx"} = $in{"xxx"} if exists( $in{"xxx"} ); |
150
|
|
|
|
|
|
|
delete( $in{"xxx"} ); |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
# Parameter yyy (type: Bool) |
153
|
|
|
|
|
|
|
exists( $in{"yyy"} ) |
154
|
|
|
|
|
|
|
or croak( "Failure in signature for foo: " . 'Missing required parameter: yyy' ); |
155
|
|
|
|
|
|
|
(!ref $tmp and (!defined $tmp or $tmp eq q() or $tmp eq '0' or $tmp eq '1')) |
156
|
|
|
|
|
|
|
or croak( "Type check failed in signature for foo: %s should be %s", "\$_{\"yyy\"}", "Bool" ); |
157
|
|
|
|
|
|
|
$out{"yyy"} = $tmp; |
158
|
|
|
|
|
|
|
delete( $in{"yyy"} ); |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
# Unrecognized parameters |
161
|
|
|
|
|
|
|
croak( "Failure in signature for foo: " . sprintf( q{Unrecognized parameter%s: %s}, keys( %in ) > 1 ? q{s} : q{}, join( q{, }, sort keys %in ) ) ) if keys %in; |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
do { @_ = ( @head, bless( \%out, "MyTest3::__NAMED_ARGUMENTS__::foo" ) ); goto $__NEXT__ }; |
164
|
|
|
|
|
|
|
}; |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
{ |
167
|
|
|
|
|
|
|
use strict; |
168
|
|
|
|
|
|
|
no warnings; |
169
|
|
|
|
|
|
|
1; |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
1; |
173
|
|
|
|
|
|
|
use strict; |
174
|
|
|
|
|
|
|
use warnings; |
175
|
|
|
|
|
|
|
no warnings qw( once void ); |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
178
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
179
|
2
|
|
|
2
|
|
16
|
our $MITE_VERSION = "0.011000"; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
58
|
|
180
|
2
|
|
|
2
|
|
12
|
# Mite keywords |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
232
|
|
181
|
0
|
|
|
0
|
|
0
|
BEGIN { |
182
|
0
|
|
|
0
|
|
0
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "MyTest4" ); |
183
|
|
|
|
|
|
|
( *after, *around, *before, *extends, *field, *has, *param, *signature_for, *with ) = do { |
184
|
|
|
|
|
|
|
no warnings 'redefine'; |
185
|
|
|
|
|
|
|
( |
186
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
187
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
188
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
189
|
|
|
|
|
|
|
sub {}, |
190
|
2
|
|
|
2
|
|
14
|
sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) }, |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
56
|
|
191
|
2
|
|
|
2
|
|
12
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
76
|
|
192
|
2
|
|
|
2
|
|
12
|
sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) }, |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
228
|
|
193
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
194
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
195
|
|
|
|
|
|
|
); |
196
|
|
|
|
|
|
|
}; |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
# Mite imports |
199
|
2
|
|
|
2
|
|
10
|
BEGIN { |
200
|
2
|
|
|
|
|
4
|
require Scalar::Util; |
201
|
|
|
|
|
|
|
*STRICT = \&Mite::Shim::STRICT; |
202
|
2
|
|
|
2
|
|
12
|
*bare = \&Mite::Shim::bare; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
484
|
|
203
|
|
|
|
|
|
|
*blessed = \&Scalar::Util::blessed; |
204
|
0
|
|
|
|
|
0
|
*carp = \&Mite::Shim::carp; |
205
|
0
|
|
|
|
|
0
|
*confess = \&Mite::Shim::confess; |
206
|
0
|
|
|
|
|
0
|
*croak = \&Mite::Shim::croak; |
207
|
|
|
|
|
|
|
*false = \&Mite::Shim::false; |
208
|
0
|
|
|
|
|
0
|
*guard = \&Mite::Shim::guard; |
209
|
0
|
|
|
|
|
0
|
*lazy = \&Mite::Shim::lazy; |
210
|
0
|
|
|
|
|
0
|
*lock = \&Mite::Shim::lock; |
211
|
2
|
|
|
|
|
12
|
*ro = \&Mite::Shim::ro; |
212
|
0
|
|
|
|
|
0
|
*rw = \&Mite::Shim::rw; |
213
|
2
|
|
|
|
|
354
|
*rwp = \&Mite::Shim::rwp; |
214
|
|
|
|
|
|
|
*true = \&Mite::Shim::true; |
215
|
|
|
|
|
|
|
*unlock = \&Mite::Shim::unlock; |
216
|
|
|
|
|
|
|
}; |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
|
219
|
2
|
|
|
2
|
|
14
|
BEGIN { |
220
|
2
|
|
|
|
|
6
|
|
221
|
2
|
|
|
|
|
2
|
|
222
|
2
|
|
|
|
|
6
|
use mro 'c3'; |
223
|
2
|
|
|
|
|
2
|
our @ISA; |
224
|
2
|
|
|
|
|
6
|
push @ISA, "MyTest3"; |
225
|
2
|
|
|
|
|
2
|
} |
226
|
2
|
|
|
|
|
4
|
|
227
|
2
|
|
|
|
|
2
|
|
228
|
2
|
|
|
|
|
4
|
# See UNIVERSAL |
229
|
2
|
|
|
|
|
4
|
my ( $self, $role ) = @_; |
230
|
2
|
|
|
|
|
4
|
our %DOES; |
231
|
2
|
|
|
|
|
2
|
return $DOES{$role} if exists $DOES{$role}; |
232
|
2
|
|
|
|
|
6
|
return 1 if $role eq __PACKAGE__; |
233
|
2
|
|
|
|
|
2
|
if ( $INC{'Moose/Util.pm'} and my $meta = Moose::Util::find_meta( ref $self or $self ) ) { |
234
|
2
|
|
|
|
|
70
|
$meta->can( 'does_role' ) and $meta->does_role( $role ) and return 1; |
235
|
|
|
|
|
|
|
} |
236
|
|
|
|
|
|
|
return $self->SUPER::DOES( $role ); |
237
|
|
|
|
|
|
|
} |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
240
|
|
|
|
|
|
|
shift->DOES( @_ ); |
241
|
2
|
|
|
2
|
|
16
|
} |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
28
|
|
242
|
2
|
|
|
2
|
|
82
|
|
243
|
2
|
|
|
|
|
1486
|
# Method signatures |
244
|
|
|
|
|
|
|
our %SIGNATURE_FOR; |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
$SIGNATURE_FOR{"foo"} = sub { |
247
|
|
|
|
|
|
|
my $__NEXT__ = shift; |
248
|
|
|
|
|
|
|
|
249
|
48
|
|
|
48
|
|
70
|
my ( %out, %in, %tmp, $tmp, $dtmp, @head ); |
250
|
48
|
|
|
|
|
48
|
|
251
|
48
|
50
|
|
|
|
70
|
@_ == 2 && (ref($_[1]) eq 'HASH') |
252
|
48
|
50
|
|
|
|
72
|
or @_ % 2 == 1 && @_ == 7 |
253
|
48
|
50
|
0
|
|
|
68
|
or croak( "Wrong number of parameters in signature for %s: got %d, %s", "foo", scalar( @_ ), "that does not seem right" ); |
|
|
|
33
|
|
|
|
|
254
|
0
|
0
|
0
|
|
|
0
|
|
255
|
|
|
|
|
|
|
@head = splice( @_, 0, 1 ); |
256
|
48
|
|
|
|
|
148
|
|
257
|
|
|
|
|
|
|
# Parameter $head[0] (type: Str) |
258
|
|
|
|
|
|
|
or croak( "Type check failed in signature for foo: %s should be %s", "\$_[0]", "Str" ); |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
%in = ( @_ == 1 and (ref($_[0]) eq 'HASH') ) ? %{ $_[0] } : @_; |
261
|
48
|
|
|
48
|
|
3286
|
|
262
|
|
|
|
|
|
|
# Parameter xxx (type: Int) |
263
|
|
|
|
|
|
|
exists( $in{"xxx"} ) |
264
|
|
|
|
|
|
|
or croak( "Failure in signature for foo: " . 'Missing required parameter: xxx' ); |
265
|
|
|
|
|
|
|
(do { my $tmp = $in{"xxx"}; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ }) |
266
|
|
|
|
|
|
|
or croak( "Type check failed in signature for foo: %s should be %s", "\$_{\"xxx\"}", "Int" ); |
267
|
|
|
|
|
|
|
$out{"xxx"} = $in{"xxx"} if exists( $in{"xxx"} ); |
268
|
|
|
|
|
|
|
delete( $in{"xxx"} ); |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
# Parameter yyy (type: Bool) |
271
|
|
|
|
|
|
|
exists( $in{"yyy"} ) |
272
|
|
|
|
|
|
|
or croak( "Failure in signature for foo: " . 'Missing required parameter: yyy' ); |
273
|
|
|
|
|
|
|
(!ref $tmp and (!defined $tmp or $tmp eq q() or $tmp eq '0' or $tmp eq '1')) |
274
|
|
|
|
|
|
|
or croak( "Type check failed in signature for foo: %s should be %s", "\$_{\"yyy\"}", "Bool" ); |
275
|
|
|
|
|
|
|
$out{"yyy"} = $tmp; |
276
|
|
|
|
|
|
|
delete( $in{"yyy"} ); |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
# Parameter zzz (type: Any) |
279
|
|
|
|
|
|
|
exists( $in{"zzz"} ) |
280
|
|
|
|
|
|
|
or croak( "Failure in signature for foo: " . 'Missing required parameter: zzz' ); |
281
|
|
|
|
|
|
|
1; # ... nothing to do |
282
|
|
|
|
|
|
|
$out{"zzz"} = $in{"zzz"} if exists( $in{"zzz"} ); |
283
|
|
|
|
|
|
|
delete( $in{"zzz"} ); |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
# Unrecognized parameters |
286
|
|
|
|
|
|
|
croak( "Failure in signature for foo: " . sprintf( q{Unrecognized parameter%s: %s}, keys( %in ) > 1 ? q{s} : q{}, join( q{, }, sort keys %in ) ) ) if keys %in; |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
do { @_ = ( @head, bless( \%out, "MyTest4::__NAMED_ARGUMENTS__::foo" ) ); goto $__NEXT__ }; |
289
|
|
|
|
|
|
|
}; |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
{ |
292
|
|
|
|
|
|
|
use strict; |
293
|
|
|
|
|
|
|
no warnings; |
294
|
|
|
|
|
|
|
1; |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
1; |