line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Mite::Class; |
4
|
109
|
|
|
109
|
|
984
|
use strict; |
|
109
|
|
|
|
|
318
|
|
|
109
|
|
|
|
|
3689
|
|
5
|
109
|
|
|
109
|
|
634
|
use warnings; |
|
109
|
|
|
|
|
406
|
|
|
109
|
|
|
|
|
3838
|
|
6
|
109
|
|
|
109
|
|
713
|
no warnings qw( once void ); |
|
109
|
|
|
|
|
308
|
|
|
109
|
|
|
|
|
13644
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
9
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
10
|
|
|
|
|
|
|
our $MITE_VERSION = "0.011000"; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Mite keywords |
13
|
|
|
|
|
|
|
BEGIN { |
14
|
109
|
|
|
109
|
|
893
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "Mite::Class" ); |
15
|
|
|
|
|
|
|
( |
16
|
|
|
|
|
|
|
*after, *around, *before, *extends, *field, |
17
|
|
|
|
|
|
|
*has, *param, *signature_for, *with |
18
|
|
|
|
|
|
|
) |
19
|
109
|
|
|
|
|
384
|
= do { |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
package Mite::Shim; |
22
|
109
|
|
|
109
|
|
781
|
no warnings 'redefine'; |
|
109
|
|
|
|
|
407
|
|
|
109
|
|
|
|
|
26583
|
|
23
|
|
|
|
|
|
|
( |
24
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
25
|
218
|
|
|
218
|
|
1123
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
26
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
27
|
|
|
|
109
|
|
|
sub { }, |
28
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) }, |
29
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
30
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) }, |
31
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
32
|
109
|
|
|
109
|
|
934
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
33
|
109
|
|
|
|
|
22030
|
); |
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Mite imports |
38
|
|
|
|
|
|
|
BEGIN { |
39
|
109
|
|
|
109
|
|
891
|
require Scalar::Util; |
40
|
109
|
|
|
|
|
457
|
*STRICT = \&Mite::Shim::STRICT; |
41
|
109
|
|
|
|
|
368
|
*bare = \&Mite::Shim::bare; |
42
|
109
|
|
|
|
|
473
|
*blessed = \&Scalar::Util::blessed; |
43
|
109
|
|
|
|
|
2860
|
*carp = \&Mite::Shim::carp; |
44
|
109
|
|
|
|
|
352
|
*confess = \&Mite::Shim::confess; |
45
|
109
|
|
|
|
|
347
|
*croak = \&Mite::Shim::croak; |
46
|
109
|
|
|
|
|
259
|
*false = \&Mite::Shim::false; |
47
|
109
|
|
|
|
|
266
|
*guard = \&Mite::Shim::guard; |
48
|
109
|
|
|
|
|
2008
|
*lazy = \&Mite::Shim::lazy; |
49
|
109
|
|
|
|
|
413
|
*lock = \&Mite::Shim::lock; |
50
|
109
|
|
|
|
|
255
|
*ro = \&Mite::Shim::ro; |
51
|
109
|
|
|
|
|
12919
|
*rw = \&Mite::Shim::rw; |
52
|
109
|
|
|
|
|
355
|
*rwp = \&Mite::Shim::rwp; |
53
|
109
|
|
|
|
|
244
|
*true = \&Mite::Shim::true; |
54
|
109
|
|
|
|
|
18437
|
*unlock = \&Mite::Shim::unlock; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
BEGIN { |
58
|
109
|
|
|
109
|
|
60263
|
require Mite::Package; |
59
|
|
|
|
|
|
|
|
60
|
109
|
|
|
109
|
|
1255
|
use mro 'c3'; |
|
109
|
|
|
|
|
329
|
|
|
109
|
|
|
|
|
2497
|
|
61
|
109
|
|
|
|
|
17539
|
our @ISA; |
62
|
109
|
|
|
|
|
195089
|
push @ISA, "Mite::Package"; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
66
|
|
|
|
|
|
|
sub new { |
67
|
143
|
50
|
|
143
|
0
|
2221
|
my $class = ref( $_[0] ) ? ref(shift) : shift; |
68
|
143
|
|
66
|
|
|
2089
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
69
|
143
|
|
|
|
|
661
|
my $self = bless {}, $class; |
70
|
|
|
|
|
|
|
my $args = |
71
|
|
|
|
|
|
|
$meta->{HAS_BUILDARGS} |
72
|
|
|
|
|
|
|
? $class->BUILDARGS(@_) |
73
|
143
|
50
|
|
|
|
1455
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
|
0
|
50
|
|
|
|
0
|
|
74
|
143
|
|
|
|
|
520
|
my $no_build = delete $args->{__no_BUILD__}; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# Attribute name (type: ValidClassName) |
77
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 11 |
78
|
143
|
50
|
|
|
|
922
|
croak "Missing key in constructor: name" unless exists $args->{"name"}; |
79
|
|
|
|
|
|
|
( |
80
|
|
|
|
|
|
|
( |
81
|
|
|
|
|
|
|
do { |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
package Mite::Shim; |
84
|
143
|
50
|
|
|
|
1160
|
defined( $args->{"name"} ) and do { |
85
|
|
|
|
|
|
|
ref( \$args->{"name"} ) eq 'SCALAR' |
86
|
143
|
50
|
|
|
|
1644
|
or ref( \( my $val = $args->{"name"} ) ) eq 'SCALAR'; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
) |
90
|
|
|
|
|
|
|
&& ( |
91
|
143
|
50
|
33
|
|
|
348
|
do { |
92
|
143
|
|
|
|
|
477
|
local $_ = $args->{"name"}; |
93
|
143
|
|
|
|
|
1787
|
/\A[^\W0-9]\w*(?:::[^\W0-9]\w*)*\z/; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
) |
96
|
|
|
|
|
|
|
) |
97
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", "name", |
98
|
|
|
|
|
|
|
"ValidClassName"; |
99
|
143
|
|
|
|
|
1118
|
$self->{"name"} = $args->{"name"}; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
# Attribute shim_name (type: ValidClassName) |
102
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 23 |
103
|
143
|
50
|
|
|
|
737
|
if ( exists $args->{"shim_name"} ) { |
104
|
|
|
|
|
|
|
( |
105
|
|
|
|
|
|
|
( |
106
|
|
|
|
|
|
|
do { |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
package Mite::Shim; |
109
|
0
|
0
|
|
|
|
0
|
defined( $args->{"shim_name"} ) and do { |
110
|
|
|
|
|
|
|
ref( \$args->{"shim_name"} ) eq 'SCALAR' |
111
|
0
|
0
|
|
|
|
0
|
or ref( \( my $val = $args->{"shim_name"} ) ) eq |
112
|
|
|
|
|
|
|
'SCALAR'; |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
) |
116
|
|
|
|
|
|
|
&& ( |
117
|
0
|
0
|
0
|
|
|
0
|
do { |
118
|
0
|
|
|
|
|
0
|
local $_ = $args->{"shim_name"}; |
119
|
0
|
|
|
|
|
0
|
/\A[^\W0-9]\w*(?:::[^\W0-9]\w*)*\z/; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
) |
122
|
|
|
|
|
|
|
) |
123
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
124
|
|
|
|
|
|
|
"shim_name", "ValidClassName"; |
125
|
0
|
|
|
|
|
0
|
$self->{"shim_name"} = $args->{"shim_name"}; |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
# Attribute source (type: Mite::Source) |
129
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 25 |
130
|
143
|
100
|
|
|
|
734
|
if ( exists $args->{"source"} ) { |
131
|
|
|
|
|
|
|
blessed( $args->{"source"} ) |
132
|
138
|
50
|
33
|
|
|
3578
|
&& $args->{"source"}->isa("Mite::Source") |
133
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
134
|
|
|
|
|
|
|
"source", "Mite::Source"; |
135
|
138
|
|
|
|
|
820
|
$self->{"source"} = $args->{"source"}; |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
require Scalar::Util && Scalar::Util::weaken( $self->{"source"} ) |
138
|
143
|
100
|
33
|
|
|
1958
|
if ref $self->{"source"}; |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
# Attribute imported_functions (type: Map[MethodName,Str]) |
141
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 34 |
142
|
143
|
|
|
|
|
367
|
do { |
143
|
|
|
|
|
|
|
my $value = |
144
|
|
|
|
|
|
|
exists( $args->{"imported_functions"} ) |
145
|
143
|
50
|
|
|
|
2037
|
? $args->{"imported_functions"} |
146
|
|
|
|
|
|
|
: $self->_build_imported_functions; |
147
|
143
|
50
|
|
|
|
344
|
do { |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
package Mite::Shim; |
150
|
143
|
50
|
|
|
|
1006
|
( ref($value) eq 'HASH' ) and do { |
151
|
143
|
|
|
|
|
407
|
my $ok = 1; |
152
|
143
|
|
|
|
|
334
|
for my $v ( values %{$value} ) { |
|
143
|
|
|
|
|
994
|
|
153
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
package Mite::Shim; |
156
|
0
|
0
|
|
|
|
0
|
defined($v) and do { |
157
|
0
|
0
|
|
|
|
0
|
ref( \$v ) eq 'SCALAR' |
158
|
|
|
|
|
|
|
or ref( \( my $val = $v ) ) eq 'SCALAR'; |
159
|
|
|
|
|
|
|
} |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
}; |
162
|
143
|
|
|
|
|
590
|
for my $k ( keys %{$value} ) { |
|
143
|
|
|
|
|
532
|
|
163
|
|
|
|
|
|
|
( $ok = 0, last ) |
164
|
|
|
|
|
|
|
unless ( |
165
|
|
|
|
|
|
|
( |
166
|
|
|
|
|
|
|
do { |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
package Mite::Shim; |
169
|
0
|
0
|
|
|
|
0
|
defined($k) and do { |
170
|
0
|
0
|
|
|
|
0
|
ref( \$k ) eq 'SCALAR' |
171
|
|
|
|
|
|
|
or ref( \( my $val = $k ) ) eq |
172
|
|
|
|
|
|
|
'SCALAR'; |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
) |
176
|
0
|
0
|
0
|
|
|
0
|
&& ( do { local $_ = $k; /\A[^\W0-9]\w*\z/ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
177
|
|
|
|
|
|
|
); |
178
|
|
|
|
|
|
|
}; |
179
|
143
|
|
|
|
|
697
|
$ok; |
180
|
|
|
|
|
|
|
} |
181
|
|
|
|
|
|
|
} |
182
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
183
|
|
|
|
|
|
|
"imported_functions", "Map[MethodName,Str]"; |
184
|
143
|
|
|
|
|
548
|
$self->{"imported_functions"} = $value; |
185
|
|
|
|
|
|
|
}; |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
# Attribute imported_keywords (type: Map[MethodName,Str]) |
188
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 39 |
189
|
143
|
|
|
|
|
504
|
do { |
190
|
|
|
|
|
|
|
my $value = |
191
|
|
|
|
|
|
|
exists( $args->{"imported_keywords"} ) |
192
|
143
|
50
|
|
|
|
1576
|
? $args->{"imported_keywords"} |
193
|
|
|
|
|
|
|
: $self->_build_imported_keywords; |
194
|
143
|
50
|
|
|
|
343
|
do { |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
package Mite::Shim; |
197
|
143
|
50
|
|
|
|
996
|
( ref($value) eq 'HASH' ) and do { |
198
|
143
|
|
|
|
|
444
|
my $ok = 1; |
199
|
143
|
|
|
|
|
340
|
for my $v ( values %{$value} ) { |
|
143
|
|
|
|
|
641
|
|
200
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
package Mite::Shim; |
203
|
0
|
0
|
|
|
|
0
|
defined($v) and do { |
204
|
0
|
0
|
|
|
|
0
|
ref( \$v ) eq 'SCALAR' |
205
|
|
|
|
|
|
|
or ref( \( my $val = $v ) ) eq 'SCALAR'; |
206
|
|
|
|
|
|
|
} |
207
|
|
|
|
|
|
|
} |
208
|
|
|
|
|
|
|
}; |
209
|
143
|
|
|
|
|
382
|
for my $k ( keys %{$value} ) { |
|
143
|
|
|
|
|
467
|
|
210
|
|
|
|
|
|
|
( $ok = 0, last ) |
211
|
|
|
|
|
|
|
unless ( |
212
|
|
|
|
|
|
|
( |
213
|
|
|
|
|
|
|
do { |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
package Mite::Shim; |
216
|
0
|
0
|
|
|
|
0
|
defined($k) and do { |
217
|
0
|
0
|
|
|
|
0
|
ref( \$k ) eq 'SCALAR' |
218
|
|
|
|
|
|
|
or ref( \( my $val = $k ) ) eq |
219
|
|
|
|
|
|
|
'SCALAR'; |
220
|
|
|
|
|
|
|
} |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
) |
223
|
0
|
0
|
0
|
|
|
0
|
&& ( do { local $_ = $k; /\A[^\W0-9]\w*\z/ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
224
|
|
|
|
|
|
|
); |
225
|
|
|
|
|
|
|
}; |
226
|
143
|
|
|
|
|
638
|
$ok; |
227
|
|
|
|
|
|
|
} |
228
|
|
|
|
|
|
|
} |
229
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
230
|
|
|
|
|
|
|
"imported_keywords", "Map[MethodName,Str]"; |
231
|
143
|
|
|
|
|
649
|
$self->{"imported_keywords"} = $value; |
232
|
|
|
|
|
|
|
}; |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
# Attribute arg |
235
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 41 |
236
|
143
|
50
|
|
|
|
711
|
$self->{"arg"} = ( exists( $args->{"arg"} ) ? $args->{"arg"} : {} ); |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
# Attribute extends (type: ArrayRef[ValidClassName]) |
239
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasSuperclasses.pm, line 28 |
240
|
143
|
|
|
|
|
746
|
do { |
241
|
|
|
|
|
|
|
my $value = |
242
|
|
|
|
|
|
|
exists( $args->{"extends"} ) |
243
|
143
|
50
|
|
|
|
1548
|
? $args->{"extends"} |
244
|
|
|
|
|
|
|
: $Mite::Trait::HasSuperclasses::__extends_DEFAULT__->( |
245
|
|
|
|
|
|
|
$self); |
246
|
143
|
50
|
|
|
|
490
|
do { |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
package Mite::Shim; |
249
|
143
|
50
|
|
|
|
843
|
( ref($value) eq 'ARRAY' ) and do { |
250
|
143
|
|
|
|
|
342
|
my $ok = 1; |
251
|
143
|
|
|
|
|
546
|
for my $i ( @{$value} ) { |
|
143
|
|
|
|
|
462
|
|
252
|
|
|
|
|
|
|
( $ok = 0, last ) |
253
|
|
|
|
|
|
|
unless ( |
254
|
|
|
|
|
|
|
( |
255
|
|
|
|
|
|
|
do { |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
package Mite::Shim; |
258
|
0
|
0
|
|
|
|
0
|
defined($i) and do { |
259
|
0
|
0
|
|
|
|
0
|
ref( \$i ) eq 'SCALAR' |
260
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) eq |
261
|
|
|
|
|
|
|
'SCALAR'; |
262
|
|
|
|
|
|
|
} |
263
|
|
|
|
|
|
|
} |
264
|
|
|
|
|
|
|
) |
265
|
|
|
|
|
|
|
&& ( |
266
|
0
|
0
|
0
|
|
|
0
|
do { |
267
|
0
|
|
|
|
|
0
|
local $_ = $i; |
268
|
0
|
|
|
|
|
0
|
/\A[^\W0-9]\w*(?:::[^\W0-9]\w*)*\z/; |
269
|
|
|
|
|
|
|
} |
270
|
|
|
|
|
|
|
) |
271
|
|
|
|
|
|
|
); |
272
|
|
|
|
|
|
|
}; |
273
|
143
|
|
|
|
|
731
|
$ok; |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
} |
276
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
277
|
|
|
|
|
|
|
"extends", "ArrayRef[ValidClassName]"; |
278
|
143
|
|
|
|
|
853
|
$self->{"extends"} = $value; |
279
|
143
|
|
|
|
|
905
|
$self->_trigger_extends( $self->{"extends"} ); |
280
|
|
|
|
|
|
|
}; |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
# Attribute superclass_args (type: Map[NonEmptyStr,HashRef|Undef]) |
283
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasSuperclasses.pm, line 33 |
284
|
143
|
|
|
|
|
384
|
do { |
285
|
|
|
|
|
|
|
my $value = |
286
|
|
|
|
|
|
|
exists( $args->{"superclass_args"} ) |
287
|
143
|
50
|
|
|
|
1065
|
? $args->{"superclass_args"} |
288
|
|
|
|
|
|
|
: $self->_build_superclass_args; |
289
|
143
|
50
|
|
|
|
1013
|
do { |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
package Mite::Shim; |
292
|
143
|
50
|
|
|
|
957
|
( ref($value) eq 'HASH' ) and do { |
293
|
143
|
|
|
|
|
420
|
my $ok = 1; |
294
|
143
|
|
|
|
|
318
|
for my $v ( values %{$value} ) { |
|
143
|
|
|
|
|
590
|
|
295
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
package Mite::Shim; |
298
|
0
|
0
|
|
|
|
0
|
( ( ref($v) eq 'HASH' ) or ( !defined($v) ) ); |
299
|
|
|
|
|
|
|
} |
300
|
|
|
|
|
|
|
}; |
301
|
143
|
|
|
|
|
350
|
for my $k ( keys %{$value} ) { |
|
143
|
|
|
|
|
1035
|
|
302
|
|
|
|
|
|
|
( $ok = 0, last ) |
303
|
|
|
|
|
|
|
unless ( |
304
|
|
|
|
|
|
|
( |
305
|
0
|
0
|
0
|
|
|
0
|
do { |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
package Mite::Shim; |
308
|
0
|
0
|
|
|
|
0
|
defined($k) and do { |
309
|
0
|
0
|
|
|
|
0
|
ref( \$k ) eq 'SCALAR' |
310
|
|
|
|
|
|
|
or ref( \( my $val = $k ) ) eq |
311
|
|
|
|
|
|
|
'SCALAR'; |
312
|
|
|
|
|
|
|
} |
313
|
|
|
|
|
|
|
} |
314
|
|
|
|
|
|
|
) |
315
|
|
|
|
|
|
|
&& ( length($k) > 0 ) |
316
|
|
|
|
|
|
|
); |
317
|
|
|
|
|
|
|
}; |
318
|
143
|
|
|
|
|
697
|
$ok; |
319
|
|
|
|
|
|
|
} |
320
|
|
|
|
|
|
|
} |
321
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
322
|
|
|
|
|
|
|
"superclass_args", "Map[NonEmptyStr,HashRef|Undef]"; |
323
|
143
|
|
|
|
|
571
|
$self->{"superclass_args"} = $value; |
324
|
|
|
|
|
|
|
}; |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
# Attribute parents (type: ArrayRef[Mite::Class]) |
327
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasSuperclasses.pm, line 36 |
328
|
143
|
50
|
|
|
|
668
|
if ( exists $args->{"parents"} ) { |
329
|
|
|
|
|
|
|
( |
330
|
0
|
|
|
|
|
0
|
do { package Mite::Shim; ref( $args->{"parents"} ) eq 'ARRAY' } |
331
|
0
|
0
|
0
|
|
|
0
|
and do { |
332
|
0
|
|
|
|
|
0
|
my $ok = 1; |
333
|
0
|
|
|
|
|
0
|
for my $i ( @{ $args->{"parents"} } ) { |
|
0
|
|
|
|
|
0
|
|
334
|
|
|
|
|
|
|
( $ok = 0, last ) |
335
|
|
|
|
|
|
|
unless ( |
336
|
0
|
0
|
|
|
|
0
|
do { |
337
|
109
|
|
|
109
|
|
5120
|
use Scalar::Util (); |
|
109
|
|
|
|
|
343
|
|
|
109
|
|
|
|
|
13913
|
|
338
|
0
|
0
|
|
|
|
0
|
Scalar::Util::blessed($i) |
339
|
|
|
|
|
|
|
and $i->isa(q[Mite::Class]); |
340
|
|
|
|
|
|
|
} |
341
|
|
|
|
|
|
|
); |
342
|
|
|
|
|
|
|
}; |
343
|
0
|
|
|
|
|
0
|
$ok; |
344
|
|
|
|
|
|
|
} |
345
|
|
|
|
|
|
|
) |
346
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
347
|
|
|
|
|
|
|
"parents", "ArrayRef[Mite::Class]"; |
348
|
0
|
|
|
|
|
0
|
$self->{"parents"} = $args->{"parents"}; |
349
|
|
|
|
|
|
|
} |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
# Attribute attributes (type: HashRef[Mite::Attribute]) |
352
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasAttributes.pm, line 16 |
353
|
143
|
|
|
|
|
327
|
do { |
354
|
|
|
|
|
|
|
my $value = |
355
|
|
|
|
|
|
|
exists( $args->{"attributes"} ) |
356
|
143
|
50
|
|
|
|
1253
|
? $args->{"attributes"} |
357
|
|
|
|
|
|
|
: $Mite::Trait::HasAttributes::__attributes_DEFAULT__ |
358
|
|
|
|
|
|
|
->($self); |
359
|
143
|
50
|
|
|
|
309
|
do { |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
package Mite::Shim; |
362
|
143
|
50
|
|
|
|
918
|
( ref($value) eq 'HASH' ) and do { |
363
|
143
|
|
|
|
|
396
|
my $ok = 1; |
364
|
143
|
|
|
|
|
311
|
for my $i ( values %{$value} ) { |
|
143
|
|
|
|
|
546
|
|
365
|
|
|
|
|
|
|
( $ok = 0, last ) |
366
|
|
|
|
|
|
|
unless ( |
367
|
0
|
0
|
|
|
|
0
|
do { |
368
|
109
|
|
|
109
|
|
790
|
use Scalar::Util (); |
|
109
|
|
|
|
|
293
|
|
|
109
|
|
|
|
|
15610
|
|
369
|
0
|
0
|
|
|
|
0
|
Scalar::Util::blessed($i) |
370
|
|
|
|
|
|
|
and $i->isa(q[Mite::Attribute]); |
371
|
|
|
|
|
|
|
} |
372
|
|
|
|
|
|
|
); |
373
|
|
|
|
|
|
|
}; |
374
|
143
|
|
|
|
|
780
|
$ok; |
375
|
|
|
|
|
|
|
} |
376
|
|
|
|
|
|
|
} |
377
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
378
|
|
|
|
|
|
|
"attributes", "HashRef[Mite::Attribute]"; |
379
|
143
|
|
|
|
|
712
|
$self->{"attributes"} = $value; |
380
|
|
|
|
|
|
|
}; |
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
# Attribute roles (type: ArrayRef[Mite::Role]) |
383
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasRoles.pm, line 19 |
384
|
143
|
|
|
|
|
432
|
do { |
385
|
|
|
|
|
|
|
my $value = |
386
|
|
|
|
|
|
|
exists( $args->{"roles"} ) |
387
|
143
|
50
|
|
|
|
955
|
? $args->{"roles"} |
388
|
|
|
|
|
|
|
: $self->_build_roles; |
389
|
143
|
50
|
|
|
|
362
|
do { |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
package Mite::Shim; |
392
|
143
|
50
|
|
|
|
905
|
( ref($value) eq 'ARRAY' ) and do { |
393
|
143
|
|
|
|
|
390
|
my $ok = 1; |
394
|
143
|
|
|
|
|
326
|
for my $i ( @{$value} ) { |
|
143
|
|
|
|
|
440
|
|
395
|
|
|
|
|
|
|
( $ok = 0, last ) |
396
|
|
|
|
|
|
|
unless ( |
397
|
0
|
0
|
|
|
|
0
|
do { |
398
|
109
|
|
|
109
|
|
949
|
use Scalar::Util (); |
|
109
|
|
|
|
|
353
|
|
|
109
|
|
|
|
|
34193
|
|
399
|
0
|
0
|
|
|
|
0
|
Scalar::Util::blessed($i) |
400
|
|
|
|
|
|
|
and $i->isa(q[Mite::Role]); |
401
|
|
|
|
|
|
|
} |
402
|
|
|
|
|
|
|
); |
403
|
|
|
|
|
|
|
}; |
404
|
143
|
|
|
|
|
886
|
$ok; |
405
|
|
|
|
|
|
|
} |
406
|
|
|
|
|
|
|
} |
407
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
408
|
|
|
|
|
|
|
"roles", "ArrayRef[Mite::Role]"; |
409
|
143
|
|
|
|
|
567
|
$self->{"roles"} = $value; |
410
|
|
|
|
|
|
|
}; |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
# Attribute role_args (type: Map[NonEmptyStr,HashRef|Undef]) |
413
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasRoles.pm, line 24 |
414
|
143
|
|
|
|
|
346
|
do { |
415
|
|
|
|
|
|
|
my $value = |
416
|
|
|
|
|
|
|
exists( $args->{"role_args"} ) |
417
|
143
|
50
|
|
|
|
897
|
? $args->{"role_args"} |
418
|
|
|
|
|
|
|
: $self->_build_role_args; |
419
|
143
|
50
|
|
|
|
492
|
do { |
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
package Mite::Shim; |
422
|
143
|
50
|
|
|
|
850
|
( ref($value) eq 'HASH' ) and do { |
423
|
143
|
|
|
|
|
370
|
my $ok = 1; |
424
|
143
|
|
|
|
|
508
|
for my $v ( values %{$value} ) { |
|
143
|
|
|
|
|
969
|
|
425
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
package Mite::Shim; |
428
|
0
|
0
|
|
|
|
0
|
( ( ref($v) eq 'HASH' ) or ( !defined($v) ) ); |
429
|
|
|
|
|
|
|
} |
430
|
|
|
|
|
|
|
}; |
431
|
143
|
|
|
|
|
432
|
for my $k ( keys %{$value} ) { |
|
143
|
|
|
|
|
460
|
|
432
|
|
|
|
|
|
|
( $ok = 0, last ) |
433
|
|
|
|
|
|
|
unless ( |
434
|
|
|
|
|
|
|
( |
435
|
0
|
0
|
0
|
|
|
0
|
do { |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
package Mite::Shim; |
438
|
0
|
0
|
|
|
|
0
|
defined($k) and do { |
439
|
0
|
0
|
|
|
|
0
|
ref( \$k ) eq 'SCALAR' |
440
|
|
|
|
|
|
|
or ref( \( my $val = $k ) ) eq |
441
|
|
|
|
|
|
|
'SCALAR'; |
442
|
|
|
|
|
|
|
} |
443
|
|
|
|
|
|
|
} |
444
|
|
|
|
|
|
|
) |
445
|
|
|
|
|
|
|
&& ( length($k) > 0 ) |
446
|
|
|
|
|
|
|
); |
447
|
|
|
|
|
|
|
}; |
448
|
143
|
|
|
|
|
694
|
$ok; |
449
|
|
|
|
|
|
|
} |
450
|
|
|
|
|
|
|
} |
451
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
452
|
|
|
|
|
|
|
"role_args", "Map[NonEmptyStr,HashRef|Undef]"; |
453
|
143
|
|
|
|
|
667
|
$self->{"role_args"} = $value; |
454
|
|
|
|
|
|
|
}; |
455
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
# Attribute method_signatures (type: Map[MethodName,Mite::Signature]) |
457
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasMethods.pm, line 20 |
458
|
143
|
|
|
|
|
720
|
do { |
459
|
|
|
|
|
|
|
my $value = |
460
|
|
|
|
|
|
|
exists( $args->{"method_signatures"} ) |
461
|
143
|
50
|
|
|
|
1312
|
? $args->{"method_signatures"} |
462
|
|
|
|
|
|
|
: $self->_build_method_signatures; |
463
|
143
|
50
|
|
|
|
346
|
do { |
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
package Mite::Shim; |
466
|
143
|
50
|
|
|
|
1021
|
( ref($value) eq 'HASH' ) and do { |
467
|
143
|
|
|
|
|
903
|
my $ok = 1; |
468
|
143
|
|
|
|
|
328
|
for my $v ( values %{$value} ) { |
|
143
|
|
|
|
|
730
|
|
469
|
|
|
|
|
|
|
( $ok = 0, last ) |
470
|
|
|
|
|
|
|
unless ( |
471
|
0
|
0
|
|
|
|
0
|
do { |
472
|
109
|
|
|
109
|
|
932
|
use Scalar::Util (); |
|
109
|
|
|
|
|
300
|
|
|
109
|
|
|
|
|
130372
|
|
473
|
0
|
0
|
|
|
|
0
|
Scalar::Util::blessed($v) |
474
|
|
|
|
|
|
|
and $v->isa(q[Mite::Signature]); |
475
|
|
|
|
|
|
|
} |
476
|
|
|
|
|
|
|
); |
477
|
|
|
|
|
|
|
}; |
478
|
143
|
|
|
|
|
555
|
for my $k ( keys %{$value} ) { |
|
143
|
|
|
|
|
468
|
|
479
|
|
|
|
|
|
|
( $ok = 0, last ) |
480
|
|
|
|
|
|
|
unless ( |
481
|
|
|
|
|
|
|
( |
482
|
|
|
|
|
|
|
do { |
483
|
|
|
|
|
|
|
|
484
|
|
|
|
|
|
|
package Mite::Shim; |
485
|
0
|
0
|
|
|
|
0
|
defined($k) and do { |
486
|
0
|
0
|
|
|
|
0
|
ref( \$k ) eq 'SCALAR' |
487
|
|
|
|
|
|
|
or ref( \( my $val = $k ) ) eq |
488
|
|
|
|
|
|
|
'SCALAR'; |
489
|
|
|
|
|
|
|
} |
490
|
|
|
|
|
|
|
} |
491
|
|
|
|
|
|
|
) |
492
|
0
|
0
|
0
|
|
|
0
|
&& ( do { local $_ = $k; /\A[^\W0-9]\w*\z/ } ) |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
493
|
|
|
|
|
|
|
); |
494
|
|
|
|
|
|
|
}; |
495
|
143
|
|
|
|
|
841
|
$ok; |
496
|
|
|
|
|
|
|
} |
497
|
|
|
|
|
|
|
} |
498
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
499
|
|
|
|
|
|
|
"method_signatures", "Map[MethodName,Mite::Signature]"; |
500
|
143
|
|
|
|
|
433
|
$self->{"method_signatures"} = $value; |
501
|
|
|
|
|
|
|
}; |
502
|
|
|
|
|
|
|
|
503
|
|
|
|
|
|
|
# Call BUILD methods |
504
|
143
|
50
|
33
|
|
|
904
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
|
143
|
50
|
|
|
|
2678
|
|
505
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
# Unrecognized parameters |
507
|
|
|
|
|
|
|
my @unknown = grep not( |
508
|
|
|
|
|
|
|
/\A(?:a(?:rg|ttributes)|extends|imported_(?:functions|keywords)|method_signatures|name|parents|role(?:_args|s)|s(?:him_name|ource|uperclass_args))\z/ |
509
|
143
|
|
|
|
|
437
|
), keys %{$args}; |
|
143
|
|
|
|
|
1888
|
|
510
|
|
|
|
|
|
|
@unknown |
511
|
143
|
50
|
|
|
|
704
|
and croak( |
512
|
|
|
|
|
|
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
513
|
|
|
|
|
|
|
|
514
|
143
|
|
|
|
|
1476
|
return $self; |
515
|
|
|
|
|
|
|
} |
516
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} |
518
|
|
|
|
|
|
|
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
519
|
|
|
|
|
|
|
|
520
|
|
|
|
|
|
|
# Accessors for attributes |
521
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasAttributes.pm, line 16 |
522
|
|
|
|
|
|
|
if ($__XS) { |
523
|
|
|
|
|
|
|
Class::XSAccessor->import( |
524
|
|
|
|
|
|
|
chained => 1, |
525
|
|
|
|
|
|
|
"getters" => { "attributes" => "attributes" }, |
526
|
|
|
|
|
|
|
); |
527
|
|
|
|
|
|
|
} |
528
|
|
|
|
|
|
|
else { |
529
|
|
|
|
|
|
|
*attributes = sub { |
530
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "attributes" usage: $self->attributes()'); |
531
|
|
|
|
|
|
|
$_[0]{"attributes"}; |
532
|
|
|
|
|
|
|
}; |
533
|
|
|
|
|
|
|
} |
534
|
|
|
|
|
|
|
|
535
|
|
|
|
|
|
|
# Accessors for extends |
536
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasSuperclasses.pm, line 28 |
537
|
|
|
|
|
|
|
sub superclasses { |
538
|
|
|
|
|
|
|
@_ > 1 |
539
|
|
|
|
|
|
|
? do { |
540
|
33
|
|
|
|
|
83
|
my @oldvalue; |
541
|
33
|
50
|
|
|
|
219
|
@oldvalue = $_[0]{"extends"} if exists $_[0]{"extends"}; |
542
|
33
|
50
|
|
|
|
73
|
do { |
543
|
|
|
|
|
|
|
|
544
|
|
|
|
|
|
|
package Mite::Shim; |
545
|
33
|
50
|
|
|
|
227
|
( ref( $_[1] ) eq 'ARRAY' ) and do { |
546
|
33
|
|
|
|
|
97
|
my $ok = 1; |
547
|
33
|
|
|
|
|
64
|
for my $i ( @{ $_[1] } ) { |
|
33
|
|
|
|
|
141
|
|
548
|
|
|
|
|
|
|
( $ok = 0, last ) |
549
|
|
|
|
|
|
|
unless ( |
550
|
|
|
|
|
|
|
( |
551
|
|
|
|
|
|
|
do { |
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
package Mite::Shim; |
554
|
37
|
50
|
|
|
|
141
|
defined($i) and do { |
555
|
37
|
50
|
|
|
|
278
|
ref( \$i ) eq 'SCALAR' |
556
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) eq |
557
|
|
|
|
|
|
|
'SCALAR'; |
558
|
|
|
|
|
|
|
} |
559
|
|
|
|
|
|
|
} |
560
|
|
|
|
|
|
|
) |
561
|
|
|
|
|
|
|
&& ( |
562
|
37
|
50
|
33
|
|
|
64
|
do { |
563
|
37
|
|
|
|
|
93
|
local $_ = $i; |
564
|
37
|
|
|
|
|
388
|
/\A[^\W0-9]\w*(?:::[^\W0-9]\w*)*\z/; |
565
|
|
|
|
|
|
|
} |
566
|
|
|
|
|
|
|
) |
567
|
|
|
|
|
|
|
); |
568
|
|
|
|
|
|
|
}; |
569
|
33
|
|
|
|
|
186
|
$ok; |
570
|
|
|
|
|
|
|
} |
571
|
|
|
|
|
|
|
} |
572
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
573
|
|
|
|
|
|
|
"accessor", "ArrayRef[ValidClassName]" ); |
574
|
33
|
|
|
|
|
96
|
$_[0]{"extends"} = $_[1]; |
575
|
33
|
|
|
|
|
175
|
$_[0]->_trigger_extends( $_[0]{"extends"}, @oldvalue ); |
576
|
33
|
|
|
|
|
122
|
$_[0]; |
577
|
|
|
|
|
|
|
} |
578
|
755
|
100
|
|
755
|
0
|
4410
|
: ( $_[0]{"extends"} ); |
579
|
|
|
|
|
|
|
} |
580
|
|
|
|
|
|
|
|
581
|
|
|
|
|
|
|
# Accessors for method_signatures |
582
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasMethods.pm, line 20 |
583
|
|
|
|
|
|
|
if ($__XS) { |
584
|
|
|
|
|
|
|
Class::XSAccessor->import( |
585
|
|
|
|
|
|
|
chained => 1, |
586
|
|
|
|
|
|
|
"getters" => { "method_signatures" => "method_signatures" }, |
587
|
|
|
|
|
|
|
); |
588
|
|
|
|
|
|
|
} |
589
|
|
|
|
|
|
|
else { |
590
|
|
|
|
|
|
|
*method_signatures = sub { |
591
|
|
|
|
|
|
|
@_ == 1 |
592
|
|
|
|
|
|
|
or croak( |
593
|
|
|
|
|
|
|
'Reader "method_signatures" usage: $self->method_signatures()'); |
594
|
|
|
|
|
|
|
$_[0]{"method_signatures"}; |
595
|
|
|
|
|
|
|
}; |
596
|
|
|
|
|
|
|
} |
597
|
|
|
|
|
|
|
|
598
|
|
|
|
|
|
|
# Accessors for parents |
599
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasSuperclasses.pm, line 36 |
600
|
|
|
|
|
|
|
sub _clear_parents { |
601
|
176
|
50
|
|
176
|
|
819
|
@_ == 1 |
602
|
|
|
|
|
|
|
or croak('Clearer "_clear_parents" usage: $self->_clear_parents()'); |
603
|
176
|
|
|
|
|
526
|
delete $_[0]{"parents"}; |
604
|
176
|
|
|
|
|
518
|
$_[0]; |
605
|
|
|
|
|
|
|
} |
606
|
|
|
|
|
|
|
|
607
|
|
|
|
|
|
|
sub parents { |
608
|
106
|
50
|
|
106
|
0
|
618
|
@_ == 1 or croak('Reader "parents" usage: $self->parents()'); |
609
|
|
|
|
|
|
|
( |
610
|
|
|
|
|
|
|
exists( $_[0]{"parents"} ) ? $_[0]{"parents"} : ( |
611
|
106
|
50
|
|
|
|
622
|
$_[0]{"parents"} = do { |
612
|
106
|
|
|
|
|
769
|
my $default_value = $_[0]->_build_parents; |
613
|
106
|
50
|
|
|
|
307
|
do { |
614
|
|
|
|
|
|
|
|
615
|
|
|
|
|
|
|
package Mite::Shim; |
616
|
106
|
50
|
|
|
|
859
|
( ref($default_value) eq 'ARRAY' ) and do { |
617
|
106
|
|
|
|
|
313
|
my $ok = 1; |
618
|
106
|
|
|
|
|
246
|
for my $i ( @{$default_value} ) { |
|
106
|
|
|
|
|
403
|
|
619
|
|
|
|
|
|
|
( $ok = 0, last ) |
620
|
|
|
|
|
|
|
unless ( |
621
|
19
|
50
|
|
|
|
47
|
do { |
622
|
109
|
|
|
109
|
|
1118
|
use Scalar::Util (); |
|
109
|
|
|
|
|
357
|
|
|
109
|
|
|
|
|
70690
|
|
623
|
19
|
50
|
|
|
|
313
|
Scalar::Util::blessed($i) |
624
|
|
|
|
|
|
|
and $i->isa(q[Mite::Class]); |
625
|
|
|
|
|
|
|
} |
626
|
|
|
|
|
|
|
); |
627
|
|
|
|
|
|
|
}; |
628
|
106
|
|
|
|
|
657
|
$ok; |
629
|
|
|
|
|
|
|
} |
630
|
|
|
|
|
|
|
} |
631
|
|
|
|
|
|
|
or croak( "Type check failed in default: %s should be %s", |
632
|
|
|
|
|
|
|
"parents", "ArrayRef[Mite::Class]" ); |
633
|
106
|
|
|
|
|
567
|
$default_value; |
634
|
|
|
|
|
|
|
} |
635
|
|
|
|
|
|
|
) |
636
|
|
|
|
|
|
|
); |
637
|
|
|
|
|
|
|
} |
638
|
|
|
|
|
|
|
|
639
|
|
|
|
|
|
|
# Accessors for role_args |
640
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasRoles.pm, line 24 |
641
|
|
|
|
|
|
|
sub role_args { |
642
|
|
|
|
|
|
|
@_ > 1 |
643
|
|
|
|
|
|
|
? do { |
644
|
0
|
0
|
|
|
|
0
|
do { |
645
|
|
|
|
|
|
|
|
646
|
|
|
|
|
|
|
package Mite::Shim; |
647
|
0
|
0
|
|
|
|
0
|
( ref( $_[1] ) eq 'HASH' ) and do { |
648
|
0
|
|
|
|
|
0
|
my $ok = 1; |
649
|
0
|
|
|
|
|
0
|
for my $v ( values %{ $_[1] } ) { |
|
0
|
|
|
|
|
0
|
|
650
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
651
|
|
|
|
|
|
|
|
652
|
|
|
|
|
|
|
package Mite::Shim; |
653
|
0
|
0
|
|
|
|
0
|
( ( ref($v) eq 'HASH' ) or ( !defined($v) ) ); |
654
|
|
|
|
|
|
|
} |
655
|
|
|
|
|
|
|
}; |
656
|
0
|
|
|
|
|
0
|
for my $k ( keys %{ $_[1] } ) { |
|
0
|
|
|
|
|
0
|
|
657
|
|
|
|
|
|
|
( $ok = 0, last ) |
658
|
|
|
|
|
|
|
unless ( |
659
|
|
|
|
|
|
|
( |
660
|
0
|
0
|
0
|
|
|
0
|
do { |
661
|
|
|
|
|
|
|
|
662
|
|
|
|
|
|
|
package Mite::Shim; |
663
|
0
|
0
|
|
|
|
0
|
defined($k) and do { |
664
|
0
|
0
|
|
|
|
0
|
ref( \$k ) eq 'SCALAR' |
665
|
|
|
|
|
|
|
or ref( \( my $val = $k ) ) eq |
666
|
|
|
|
|
|
|
'SCALAR'; |
667
|
|
|
|
|
|
|
} |
668
|
|
|
|
|
|
|
} |
669
|
|
|
|
|
|
|
) |
670
|
|
|
|
|
|
|
&& ( length($k) > 0 ) |
671
|
|
|
|
|
|
|
); |
672
|
|
|
|
|
|
|
}; |
673
|
0
|
|
|
|
|
0
|
$ok; |
674
|
|
|
|
|
|
|
} |
675
|
|
|
|
|
|
|
} |
676
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
677
|
|
|
|
|
|
|
"accessor", "Map[NonEmptyStr,HashRef|Undef]" ); |
678
|
0
|
|
|
|
|
0
|
$_[0]{"role_args"} = $_[1]; |
679
|
0
|
|
|
|
|
0
|
$_[0]; |
680
|
|
|
|
|
|
|
} |
681
|
28
|
50
|
|
28
|
0
|
253
|
: ( $_[0]{"role_args"} ); |
682
|
|
|
|
|
|
|
} |
683
|
|
|
|
|
|
|
|
684
|
|
|
|
|
|
|
# Accessors for roles |
685
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasRoles.pm, line 19 |
686
|
|
|
|
|
|
|
sub roles { |
687
|
|
|
|
|
|
|
@_ > 1 |
688
|
|
|
|
|
|
|
? do { |
689
|
0
|
0
|
|
|
|
0
|
do { |
690
|
|
|
|
|
|
|
|
691
|
|
|
|
|
|
|
package Mite::Shim; |
692
|
0
|
0
|
|
|
|
0
|
( ref( $_[1] ) eq 'ARRAY' ) and do { |
693
|
0
|
|
|
|
|
0
|
my $ok = 1; |
694
|
0
|
|
|
|
|
0
|
for my $i ( @{ $_[1] } ) { |
|
0
|
|
|
|
|
0
|
|
695
|
|
|
|
|
|
|
( $ok = 0, last ) |
696
|
|
|
|
|
|
|
unless ( |
697
|
0
|
0
|
|
|
|
0
|
do { |
698
|
109
|
|
|
109
|
|
1005
|
use Scalar::Util (); |
|
109
|
|
|
|
|
319
|
|
|
109
|
|
|
|
|
79054
|
|
699
|
0
|
0
|
|
|
|
0
|
Scalar::Util::blessed($i) |
700
|
|
|
|
|
|
|
and $i->isa(q[Mite::Role]); |
701
|
|
|
|
|
|
|
} |
702
|
|
|
|
|
|
|
); |
703
|
|
|
|
|
|
|
}; |
704
|
0
|
|
|
|
|
0
|
$ok; |
705
|
|
|
|
|
|
|
} |
706
|
|
|
|
|
|
|
} |
707
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
708
|
|
|
|
|
|
|
"accessor", "ArrayRef[Mite::Role]" ); |
709
|
0
|
|
|
|
|
0
|
$_[0]{"roles"} = $_[1]; |
710
|
0
|
|
|
|
|
0
|
$_[0]; |
711
|
|
|
|
|
|
|
} |
712
|
244
|
50
|
|
244
|
0
|
1491
|
: ( $_[0]{"roles"} ); |
713
|
|
|
|
|
|
|
} |
714
|
|
|
|
|
|
|
|
715
|
|
|
|
|
|
|
# Accessors for superclass_args |
716
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Trait/HasSuperclasses.pm, line 33 |
717
|
|
|
|
|
|
|
sub superclass_args { |
718
|
|
|
|
|
|
|
@_ > 1 |
719
|
|
|
|
|
|
|
? do { |
720
|
23
|
50
|
|
|
|
49
|
do { |
721
|
|
|
|
|
|
|
|
722
|
|
|
|
|
|
|
package Mite::Shim; |
723
|
23
|
50
|
|
|
|
237
|
( ref( $_[1] ) eq 'HASH' ) and do { |
724
|
23
|
|
|
|
|
65
|
my $ok = 1; |
725
|
23
|
|
|
|
|
59
|
for my $v ( values %{ $_[1] } ) { |
|
23
|
|
|
|
|
120
|
|
726
|
25
|
50
|
|
|
|
66
|
( $ok = 0, last ) unless do { |
727
|
|
|
|
|
|
|
|
728
|
|
|
|
|
|
|
package Mite::Shim; |
729
|
25
|
50
|
|
|
|
238
|
( ( ref($v) eq 'HASH' ) or ( !defined($v) ) ); |
730
|
|
|
|
|
|
|
} |
731
|
|
|
|
|
|
|
}; |
732
|
23
|
|
|
|
|
60
|
for my $k ( keys %{ $_[1] } ) { |
|
23
|
|
|
|
|
95
|
|
733
|
|
|
|
|
|
|
( $ok = 0, last ) |
734
|
|
|
|
|
|
|
unless ( |
735
|
|
|
|
|
|
|
( |
736
|
25
|
50
|
33
|
|
|
49
|
do { |
737
|
|
|
|
|
|
|
|
738
|
|
|
|
|
|
|
package Mite::Shim; |
739
|
25
|
50
|
|
|
|
93
|
defined($k) and do { |
740
|
25
|
50
|
|
|
|
296
|
ref( \$k ) eq 'SCALAR' |
741
|
|
|
|
|
|
|
or ref( \( my $val = $k ) ) eq |
742
|
|
|
|
|
|
|
'SCALAR'; |
743
|
|
|
|
|
|
|
} |
744
|
|
|
|
|
|
|
} |
745
|
|
|
|
|
|
|
) |
746
|
|
|
|
|
|
|
&& ( length($k) > 0 ) |
747
|
|
|
|
|
|
|
); |
748
|
|
|
|
|
|
|
}; |
749
|
23
|
|
|
|
|
124
|
$ok; |
750
|
|
|
|
|
|
|
} |
751
|
|
|
|
|
|
|
} |
752
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
753
|
|
|
|
|
|
|
"accessor", "Map[NonEmptyStr,HashRef|Undef]" ); |
754
|
23
|
|
|
|
|
83
|
$_[0]{"superclass_args"} = $_[1]; |
755
|
23
|
|
|
|
|
69
|
$_[0]; |
756
|
|
|
|
|
|
|
} |
757
|
50
|
100
|
|
50
|
0
|
332
|
: ( $_[0]{"superclass_args"} ); |
758
|
|
|
|
|
|
|
} |
759
|
|
|
|
|
|
|
|
760
|
|
|
|
|
|
|
BEGIN { |
761
|
109
|
|
|
109
|
|
60810
|
require Mite::Trait::HasSuperclasses; |
762
|
109
|
|
|
|
|
53688
|
require Mite::Trait::HasConstructor; |
763
|
109
|
|
|
|
|
47367
|
require Mite::Trait::HasDestructor; |
764
|
109
|
|
|
|
|
50107
|
require Mite::Trait::HasAttributes; |
765
|
109
|
|
|
|
|
50222
|
require Mite::Trait::HasRoles; |
766
|
109
|
|
|
|
|
55913
|
require Mite::Trait::HasMethods; |
767
|
109
|
|
|
|
|
49066
|
require Mite::Trait::HasMOP; |
768
|
|
|
|
|
|
|
|
769
|
109
|
|
|
|
|
136935
|
our %DOES = ( |
770
|
|
|
|
|
|
|
"Mite::Class" => 1, |
771
|
|
|
|
|
|
|
"Mite::Trait::HasSuperclasses" => 1, |
772
|
|
|
|
|
|
|
"Mite::Trait::HasConstructor" => 1, |
773
|
|
|
|
|
|
|
"Mite::Trait::HasDestructor" => 1, |
774
|
|
|
|
|
|
|
"Mite::Trait::HasAttributes" => 1, |
775
|
|
|
|
|
|
|
"Mite::Trait::HasRoles" => 1, |
776
|
|
|
|
|
|
|
"Mite::Trait::HasMethods" => 1, |
777
|
|
|
|
|
|
|
"Mite::Trait::HasMOP" => 1 |
778
|
|
|
|
|
|
|
); |
779
|
|
|
|
|
|
|
} |
780
|
|
|
|
|
|
|
|
781
|
|
|
|
|
|
|
# See UNIVERSAL |
782
|
|
|
|
|
|
|
sub DOES { |
783
|
0
|
|
|
0
|
0
|
0
|
my ( $self, $role ) = @_; |
784
|
0
|
|
|
|
|
0
|
our %DOES; |
785
|
0
|
0
|
|
|
|
0
|
return $DOES{$role} if exists $DOES{$role}; |
786
|
0
|
0
|
|
|
|
0
|
return 1 if $role eq __PACKAGE__; |
787
|
0
|
0
|
0
|
|
|
0
|
if ( $INC{'Moose/Util.pm'} |
|
|
|
0
|
|
|
|
|
788
|
|
|
|
|
|
|
and my $meta = Moose::Util::find_meta( ref $self or $self ) ) |
789
|
|
|
|
|
|
|
{ |
790
|
0
|
0
|
0
|
|
|
0
|
$meta->can('does_role') and $meta->does_role($role) and return 1; |
791
|
|
|
|
|
|
|
} |
792
|
0
|
|
|
|
|
0
|
return $self->SUPER::DOES($role); |
793
|
|
|
|
|
|
|
} |
794
|
|
|
|
|
|
|
|
795
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
796
|
|
|
|
|
|
|
sub does { |
797
|
0
|
|
|
0
|
0
|
0
|
shift->DOES(@_); |
798
|
|
|
|
|
|
|
} |
799
|
|
|
|
|
|
|
|
800
|
|
|
|
|
|
|
# Methods from roles |
801
|
113
|
|
|
113
|
|
517
|
sub _all_subs { goto \&Mite::Trait::HasMethods::_all_subs; } |
802
|
|
|
|
|
|
|
|
803
|
|
|
|
|
|
|
sub _build_method_signatures { |
804
|
143
|
|
|
143
|
|
935
|
goto \&Mite::Trait::HasMethods::_build_method_signatures; |
805
|
|
|
|
|
|
|
} |
806
|
|
|
|
|
|
|
|
807
|
|
|
|
|
|
|
sub _build_parents { |
808
|
106
|
|
|
106
|
|
615
|
goto \&Mite::Trait::HasSuperclasses::_build_parents; |
809
|
|
|
|
|
|
|
} |
810
|
|
|
|
|
|
|
|
811
|
|
|
|
|
|
|
sub _build_role_args { |
812
|
143
|
|
|
143
|
|
698
|
goto \&Mite::Trait::HasRoles::_build_role_args; |
813
|
|
|
|
|
|
|
} |
814
|
143
|
|
|
143
|
|
948
|
sub _build_roles { goto \&Mite::Trait::HasRoles::_build_roles; } |
815
|
|
|
|
|
|
|
|
816
|
|
|
|
|
|
|
sub _build_superclass_args { |
817
|
143
|
|
|
143
|
|
998
|
goto \&Mite::Trait::HasSuperclasses::_build_superclass_args; |
818
|
|
|
|
|
|
|
} |
819
|
|
|
|
|
|
|
|
820
|
|
|
|
|
|
|
sub _compile_attribute_accessors { |
821
|
|
|
|
|
|
|
goto |
822
|
113
|
|
|
113
|
|
703
|
\&Mite::Trait::HasAttributes::_compile_attribute_accessors; |
823
|
|
|
|
|
|
|
} |
824
|
|
|
|
|
|
|
|
825
|
|
|
|
|
|
|
sub _compile_bless { |
826
|
104
|
|
|
104
|
|
754
|
goto \&Mite::Trait::HasConstructor::_compile_bless; |
827
|
|
|
|
|
|
|
} |
828
|
|
|
|
|
|
|
|
829
|
|
|
|
|
|
|
sub _compile_buildall { |
830
|
104
|
|
|
104
|
|
775
|
goto \&Mite::Trait::HasConstructor::_compile_buildall; |
831
|
|
|
|
|
|
|
} |
832
|
|
|
|
|
|
|
|
833
|
|
|
|
|
|
|
sub _compile_buildall_method { |
834
|
90
|
|
|
90
|
|
579
|
goto \&Mite::Trait::HasConstructor::_compile_buildall_method; |
835
|
|
|
|
|
|
|
} |
836
|
|
|
|
|
|
|
|
837
|
|
|
|
|
|
|
sub _compile_buildargs { |
838
|
105
|
|
|
105
|
|
612
|
goto \&Mite::Trait::HasConstructor::_compile_buildargs; |
839
|
|
|
|
|
|
|
} |
840
|
|
|
|
|
|
|
|
841
|
|
|
|
|
|
|
sub _compile_composed_methods { |
842
|
113
|
|
|
113
|
|
513
|
goto \&Mite::Trait::HasRoles::_compile_composed_methods; |
843
|
|
|
|
|
|
|
} |
844
|
|
|
|
|
|
|
|
845
|
|
|
|
|
|
|
sub _compile_destroy { |
846
|
90
|
|
|
90
|
|
611
|
goto \&Mite::Trait::HasDestructor::_compile_destroy; |
847
|
|
|
|
|
|
|
} |
848
|
113
|
|
|
113
|
|
557
|
sub _compile_does { goto \&Mite::Trait::HasRoles::_compile_does; } |
849
|
|
|
|
|
|
|
|
850
|
|
|
|
|
|
|
sub _compile_extends { |
851
|
113
|
|
|
113
|
|
770
|
goto \&Mite::Trait::HasSuperclasses::_compile_extends; |
852
|
|
|
|
|
|
|
} |
853
|
|
|
|
|
|
|
|
854
|
|
|
|
|
|
|
sub _compile_init_attributes { |
855
|
104
|
|
|
104
|
|
680
|
goto \&Mite::Trait::HasAttributes::_compile_init_attributes; |
856
|
|
|
|
|
|
|
} |
857
|
|
|
|
|
|
|
|
858
|
|
|
|
|
|
|
sub _compile_method_signatures { |
859
|
113
|
|
|
113
|
|
762
|
goto \&Mite::Trait::HasMethods::_compile_method_signatures; |
860
|
|
|
|
|
|
|
} |
861
|
0
|
|
|
0
|
|
0
|
sub _compile_mop { goto \&Mite::Trait::HasMOP::_compile_mop; } |
862
|
|
|
|
|
|
|
|
863
|
|
|
|
|
|
|
sub _compile_mop_attributes { |
864
|
|
|
|
|
|
|
goto \&Mite::Trait::HasMOP::_compile_mop_attributes; |
865
|
|
|
|
|
|
|
} |
866
|
|
|
|
|
|
|
|
867
|
|
|
|
|
|
|
sub _compile_mop_methods { |
868
|
0
|
|
|
0
|
|
0
|
goto \&Mite::Trait::HasMOP::_compile_mop_methods; |
869
|
|
|
|
|
|
|
} |
870
|
|
|
|
|
|
|
|
871
|
|
|
|
|
|
|
sub _compile_mop_modifiers { |
872
|
0
|
|
|
0
|
|
0
|
goto \&Mite::Trait::HasMOP::_compile_mop_modifiers; |
873
|
|
|
|
|
|
|
} |
874
|
|
|
|
|
|
|
|
875
|
|
|
|
|
|
|
sub _compile_mop_postamble { |
876
|
|
|
|
|
|
|
goto \&Mite::Trait::HasMOP::_compile_mop_postamble; |
877
|
|
|
|
|
|
|
} |
878
|
|
|
|
|
|
|
|
879
|
|
|
|
|
|
|
sub _compile_mop_required_methods { |
880
|
0
|
|
|
0
|
|
0
|
goto \&Mite::Trait::HasMOP::_compile_mop_required_methods; |
881
|
|
|
|
|
|
|
} |
882
|
|
|
|
|
|
|
|
883
|
|
|
|
|
|
|
sub _compile_mop_tc { |
884
|
0
|
|
|
0
|
|
0
|
goto \&Mite::Trait::HasMOP::_compile_mop_tc; |
885
|
|
|
|
|
|
|
} |
886
|
|
|
|
|
|
|
|
887
|
|
|
|
|
|
|
sub _compile_new { |
888
|
104
|
|
|
104
|
|
740
|
goto \&Mite::Trait::HasConstructor::_compile_new; |
889
|
|
|
|
|
|
|
} |
890
|
|
|
|
|
|
|
|
891
|
|
|
|
|
|
|
sub _compile_strict_constructor { |
892
|
|
|
|
|
|
|
goto |
893
|
104
|
|
|
104
|
|
617
|
\&Mite::Trait::HasConstructor::_compile_strict_constructor; |
894
|
|
|
|
|
|
|
} |
895
|
113
|
|
|
113
|
|
698
|
sub _compile_with { goto \&Mite::Trait::HasRoles::_compile_with; } |
896
|
|
|
|
|
|
|
|
897
|
|
|
|
|
|
|
sub _get_parent { |
898
|
98
|
|
|
98
|
|
387
|
goto \&Mite::Trait::HasSuperclasses::_get_parent; |
899
|
|
|
|
|
|
|
} |
900
|
9
|
|
|
9
|
|
43
|
sub _get_role { goto \&Mite::Trait::HasRoles::_get_role; } |
901
|
176
|
|
|
176
|
|
976
|
sub _set_isa { goto \&Mite::Trait::HasSuperclasses::_set_isa; } |
902
|
|
|
|
|
|
|
|
903
|
|
|
|
|
|
|
sub _trigger_extends { |
904
|
176
|
|
|
176
|
|
1251
|
goto \&Mite::Trait::HasSuperclasses::_trigger_extends; |
905
|
|
|
|
|
|
|
} |
906
|
|
|
|
|
|
|
|
907
|
|
|
|
|
|
|
sub add_attribute { |
908
|
105
|
|
|
105
|
0
|
719
|
goto \&Mite::Trait::HasAttributes::add_attribute; |
909
|
|
|
|
|
|
|
} |
910
|
|
|
|
|
|
|
|
911
|
|
|
|
|
|
|
sub add_attributes { |
912
|
|
|
|
|
|
|
goto \&Mite::Trait::HasAttributes::add_attributes; |
913
|
|
|
|
|
|
|
} |
914
|
|
|
|
|
|
|
|
915
|
|
|
|
|
|
|
sub add_method_signature { |
916
|
7
|
|
|
7
|
0
|
37
|
goto \&Mite::Trait::HasMethods::add_method_signature; |
917
|
|
|
|
|
|
|
} |
918
|
9
|
|
|
9
|
0
|
63
|
sub add_role { goto \&Mite::Trait::HasRoles::add_role; } |
919
|
|
|
|
|
|
|
|
920
|
|
|
|
|
|
|
sub add_roles_by_name { |
921
|
9
|
|
|
9
|
0
|
59
|
goto \&Mite::Trait::HasRoles::add_roles_by_name; |
922
|
|
|
|
|
|
|
} |
923
|
|
|
|
|
|
|
|
924
|
|
|
|
|
|
|
sub all_attributes { |
925
|
|
|
|
|
|
|
goto \&Mite::Trait::HasAttributes::all_attributes; |
926
|
|
|
|
|
|
|
} |
927
|
9
|
|
|
9
|
0
|
47
|
sub does_list { goto \&Mite::Trait::HasRoles::does_list; } |
928
|
|
|
|
|
|
|
|
929
|
|
|
|
|
|
|
sub extend_attribute { |
930
|
|
|
|
|
|
|
goto \&Mite::Trait::HasAttributes::extend_attribute; |
931
|
|
|
|
|
|
|
} |
932
|
2
|
|
|
2
|
0
|
10
|
sub get_isa { goto \&Mite::Trait::HasSuperclasses::get_isa; } |
933
|
|
|
|
|
|
|
|
934
|
|
|
|
|
|
|
sub handle_extends_keyword { |
935
|
23
|
|
|
23
|
0
|
171
|
goto \&Mite::Trait::HasSuperclasses::handle_extends_keyword; |
936
|
|
|
|
|
|
|
} |
937
|
|
|
|
|
|
|
|
938
|
|
|
|
|
|
|
sub handle_with_keyword { |
939
|
9
|
|
|
9
|
0
|
67
|
goto \&Mite::Trait::HasRoles::handle_with_keyword; |
940
|
|
|
|
|
|
|
} |
941
|
|
|
|
|
|
|
sub linear_isa { |
942
|
621
|
|
|
621
|
0
|
4181
|
goto \&Mite::Trait::HasSuperclasses::linear_isa; |
943
|
|
|
|
|
|
|
} |
944
|
|
|
|
|
|
|
|
945
|
|
|
|
|
|
|
sub linear_parents { |
946
|
71
|
|
|
71
|
0
|
2511
|
goto \&Mite::Trait::HasSuperclasses::linear_parents; |
947
|
|
|
|
|
|
|
} |
948
|
|
|
|
|
|
|
|
949
|
|
|
|
|
|
|
sub methods_to_import_from_roles { |
950
|
113
|
|
|
113
|
0
|
671
|
goto \&Mite::Trait::HasRoles::methods_to_import_from_roles; |
951
|
|
|
|
|
|
|
} |
952
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
sub native_methods { |
954
|
113
|
|
|
113
|
0
|
734
|
goto \&Mite::Trait::HasMethods::native_methods; |
955
|
|
|
|
|
|
|
} |
956
|
|
|
|
|
|
|
|
957
|
|
|
|
|
|
|
1; |
958
|
|
|
|
|
|
|
} |