| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
{ |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Mite::Package; |
|
4
|
109
|
|
|
109
|
|
964
|
use strict; |
|
|
109
|
|
|
|
|
690
|
|
|
|
109
|
|
|
|
|
16512
|
|
|
5
|
109
|
|
|
109
|
|
747
|
use warnings; |
|
|
109
|
|
|
|
|
344
|
|
|
|
109
|
|
|
|
|
29584
|
|
|
6
|
109
|
|
|
109
|
|
686
|
no warnings qw( once void ); |
|
|
109
|
|
|
|
|
12598
|
|
|
|
109
|
|
|
|
|
14554
|
|
|
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
|
|
695
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "Mite::Package" ); |
|
15
|
|
|
|
|
|
|
( |
|
16
|
|
|
|
|
|
|
*after, *around, *before, *extends, *field, |
|
17
|
|
|
|
|
|
|
*has, *param, *signature_for, *with |
|
18
|
|
|
|
|
|
|
) |
|
19
|
109
|
|
|
|
|
331
|
= do { |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
package Mite::Shim; |
|
22
|
109
|
|
|
109
|
|
26688
|
no warnings 'redefine'; |
|
|
109
|
|
|
|
|
313
|
|
|
|
109
|
|
|
|
|
26839
|
|
|
23
|
|
|
|
|
|
|
( |
|
24
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
|
25
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
|
26
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
|
27
|
|
|
|
0
|
|
|
sub { }, |
|
28
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) }, |
|
29
|
654
|
|
|
654
|
|
156226
|
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
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
|
33
|
109
|
|
|
|
|
21900
|
); |
|
34
|
|
|
|
|
|
|
}; |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Mite imports |
|
38
|
|
|
|
|
|
|
BEGIN { |
|
39
|
109
|
|
|
109
|
|
869
|
require Scalar::Util; |
|
40
|
109
|
|
|
|
|
475
|
*STRICT = \&Mite::Shim::STRICT; |
|
41
|
109
|
|
|
|
|
12532
|
*bare = \&Mite::Shim::bare; |
|
42
|
109
|
|
|
|
|
327
|
*blessed = \&Scalar::Util::blessed; |
|
43
|
109
|
|
|
|
|
14145
|
*carp = \&Mite::Shim::carp; |
|
44
|
109
|
|
|
|
|
13162
|
*confess = \&Mite::Shim::confess; |
|
45
|
109
|
|
|
|
|
269
|
*croak = \&Mite::Shim::croak; |
|
46
|
109
|
|
|
|
|
259
|
*false = \&Mite::Shim::false; |
|
47
|
109
|
|
|
|
|
278
|
*guard = \&Mite::Shim::guard; |
|
48
|
109
|
|
|
|
|
329
|
*lazy = \&Mite::Shim::lazy; |
|
49
|
109
|
|
|
|
|
298
|
*lock = \&Mite::Shim::lock; |
|
50
|
109
|
|
|
|
|
337
|
*ro = \&Mite::Shim::ro; |
|
51
|
109
|
|
|
|
|
13128
|
*rw = \&Mite::Shim::rw; |
|
52
|
109
|
|
|
|
|
312
|
*rwp = \&Mite::Shim::rwp; |
|
53
|
109
|
|
|
|
|
287
|
*true = \&Mite::Shim::true; |
|
54
|
109
|
|
|
|
|
4495
|
*unlock = \&Mite::Shim::unlock; |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# Gather metadata for constructor and destructor |
|
58
|
|
|
|
|
|
|
sub __META__ { |
|
59
|
109
|
|
|
109
|
|
835
|
no strict 'refs'; |
|
|
109
|
|
|
|
|
347
|
|
|
|
109
|
|
|
|
|
201414
|
|
|
60
|
101
|
|
|
101
|
|
566
|
my $class = shift; |
|
61
|
101
|
|
33
|
|
|
671
|
$class = ref($class) || $class; |
|
62
|
101
|
|
|
|
|
637
|
my $linear_isa = mro::get_linear_isa($class); |
|
63
|
|
|
|
|
|
|
return { |
|
64
|
|
|
|
|
|
|
BUILD => [ |
|
65
|
204
|
100
|
|
|
|
419
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
|
204
|
|
|
|
|
1706
|
|
|
|
101
|
|
|
|
|
416
|
|
|
66
|
204
|
|
|
|
|
784
|
map { "$_\::BUILD" } reverse @$linear_isa |
|
67
|
|
|
|
|
|
|
], |
|
68
|
|
|
|
|
|
|
DEMOLISH => [ |
|
69
|
204
|
50
|
|
|
|
657
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
|
204
|
|
|
|
|
3062
|
|
|
|
0
|
|
|
|
|
0
|
|
|
70
|
101
|
|
|
|
|
463
|
map { "$_\::DEMOLISH" } @$linear_isa |
|
|
204
|
|
|
|
|
816
|
|
|
71
|
|
|
|
|
|
|
], |
|
72
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
|
73
|
|
|
|
|
|
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
|
74
|
|
|
|
|
|
|
}; |
|
75
|
|
|
|
|
|
|
} |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
|
78
|
|
|
|
|
|
|
sub new { |
|
79
|
0
|
0
|
|
0
|
0
|
0
|
my $class = ref( $_[0] ) ? ref(shift) : shift; |
|
80
|
0
|
|
0
|
|
|
0
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
|
81
|
0
|
|
|
|
|
0
|
my $self = bless {}, $class; |
|
82
|
|
|
|
|
|
|
my $args = |
|
83
|
|
|
|
|
|
|
$meta->{HAS_BUILDARGS} |
|
84
|
|
|
|
|
|
|
? $class->BUILDARGS(@_) |
|
85
|
0
|
0
|
|
|
|
0
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
|
|
0
|
0
|
|
|
|
0
|
|
|
86
|
0
|
|
|
|
|
0
|
my $no_build = delete $args->{__no_BUILD__}; |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# Attribute name (type: ValidClassName) |
|
89
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 11 |
|
90
|
0
|
0
|
|
|
|
0
|
croak "Missing key in constructor: name" unless exists $args->{"name"}; |
|
91
|
|
|
|
|
|
|
( |
|
92
|
|
|
|
|
|
|
( |
|
93
|
|
|
|
|
|
|
do { |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
package Mite::Shim; |
|
96
|
0
|
0
|
|
|
|
0
|
defined( $args->{"name"} ) and do { |
|
97
|
|
|
|
|
|
|
ref( \$args->{"name"} ) eq 'SCALAR' |
|
98
|
0
|
0
|
|
|
|
0
|
or ref( \( my $val = $args->{"name"} ) ) eq 'SCALAR'; |
|
99
|
|
|
|
|
|
|
} |
|
100
|
|
|
|
|
|
|
} |
|
101
|
|
|
|
|
|
|
) |
|
102
|
|
|
|
|
|
|
&& ( |
|
103
|
0
|
0
|
0
|
|
|
0
|
do { |
|
104
|
0
|
|
|
|
|
0
|
local $_ = $args->{"name"}; |
|
105
|
0
|
|
|
|
|
0
|
/\A[^\W0-9]\w*(?:::[^\W0-9]\w*)*\z/; |
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
) |
|
108
|
|
|
|
|
|
|
) |
|
109
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", "name", |
|
110
|
|
|
|
|
|
|
"ValidClassName"; |
|
111
|
0
|
|
|
|
|
0
|
$self->{"name"} = $args->{"name"}; |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
# Attribute shim_name (type: ValidClassName) |
|
114
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 23 |
|
115
|
0
|
0
|
|
|
|
0
|
if ( exists $args->{"shim_name"} ) { |
|
116
|
|
|
|
|
|
|
( |
|
117
|
|
|
|
|
|
|
( |
|
118
|
|
|
|
|
|
|
do { |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
package Mite::Shim; |
|
121
|
0
|
0
|
|
|
|
0
|
defined( $args->{"shim_name"} ) and do { |
|
122
|
|
|
|
|
|
|
ref( \$args->{"shim_name"} ) eq 'SCALAR' |
|
123
|
0
|
0
|
|
|
|
0
|
or ref( \( my $val = $args->{"shim_name"} ) ) eq |
|
124
|
|
|
|
|
|
|
'SCALAR'; |
|
125
|
|
|
|
|
|
|
} |
|
126
|
|
|
|
|
|
|
} |
|
127
|
|
|
|
|
|
|
) |
|
128
|
|
|
|
|
|
|
&& ( |
|
129
|
0
|
0
|
0
|
|
|
0
|
do { |
|
130
|
0
|
|
|
|
|
0
|
local $_ = $args->{"shim_name"}; |
|
131
|
0
|
|
|
|
|
0
|
/\A[^\W0-9]\w*(?:::[^\W0-9]\w*)*\z/; |
|
132
|
|
|
|
|
|
|
} |
|
133
|
|
|
|
|
|
|
) |
|
134
|
|
|
|
|
|
|
) |
|
135
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
|
136
|
|
|
|
|
|
|
"shim_name", "ValidClassName"; |
|
137
|
0
|
|
|
|
|
0
|
$self->{"shim_name"} = $args->{"shim_name"}; |
|
138
|
|
|
|
|
|
|
} |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
# Attribute source (type: Mite::Source) |
|
141
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 25 |
|
142
|
0
|
0
|
|
|
|
0
|
if ( exists $args->{"source"} ) { |
|
143
|
|
|
|
|
|
|
blessed( $args->{"source"} ) |
|
144
|
0
|
0
|
0
|
|
|
0
|
&& $args->{"source"}->isa("Mite::Source") |
|
145
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
|
146
|
|
|
|
|
|
|
"source", "Mite::Source"; |
|
147
|
0
|
|
|
|
|
0
|
$self->{"source"} = $args->{"source"}; |
|
148
|
|
|
|
|
|
|
} |
|
149
|
|
|
|
|
|
|
require Scalar::Util && Scalar::Util::weaken( $self->{"source"} ) |
|
150
|
0
|
0
|
0
|
|
|
0
|
if ref $self->{"source"}; |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
# Attribute imported_functions (type: Map[MethodName,Str]) |
|
153
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 34 |
|
154
|
0
|
|
|
|
|
0
|
do { |
|
155
|
|
|
|
|
|
|
my $value = |
|
156
|
|
|
|
|
|
|
exists( $args->{"imported_functions"} ) |
|
157
|
0
|
0
|
|
|
|
0
|
? $args->{"imported_functions"} |
|
158
|
|
|
|
|
|
|
: $self->_build_imported_functions; |
|
159
|
0
|
0
|
|
|
|
0
|
do { |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
package Mite::Shim; |
|
162
|
0
|
0
|
|
|
|
0
|
( ref($value) eq 'HASH' ) and do { |
|
163
|
0
|
|
|
|
|
0
|
my $ok = 1; |
|
164
|
0
|
|
|
|
|
0
|
for my $v ( values %{$value} ) { |
|
|
0
|
|
|
|
|
0
|
|
|
165
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
package Mite::Shim; |
|
168
|
0
|
0
|
|
|
|
0
|
defined($v) and do { |
|
169
|
0
|
0
|
|
|
|
0
|
ref( \$v ) eq 'SCALAR' |
|
170
|
|
|
|
|
|
|
or ref( \( my $val = $v ) ) eq 'SCALAR'; |
|
171
|
|
|
|
|
|
|
} |
|
172
|
|
|
|
|
|
|
} |
|
173
|
|
|
|
|
|
|
}; |
|
174
|
0
|
|
|
|
|
0
|
for my $k ( keys %{$value} ) { |
|
|
0
|
|
|
|
|
0
|
|
|
175
|
|
|
|
|
|
|
( $ok = 0, last ) |
|
176
|
|
|
|
|
|
|
unless ( |
|
177
|
|
|
|
|
|
|
( |
|
178
|
|
|
|
|
|
|
do { |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
package Mite::Shim; |
|
181
|
0
|
0
|
|
|
|
0
|
defined($k) and do { |
|
182
|
0
|
0
|
|
|
|
0
|
ref( \$k ) eq 'SCALAR' |
|
183
|
|
|
|
|
|
|
or ref( \( my $val = $k ) ) eq |
|
184
|
|
|
|
|
|
|
'SCALAR'; |
|
185
|
|
|
|
|
|
|
} |
|
186
|
|
|
|
|
|
|
} |
|
187
|
|
|
|
|
|
|
) |
|
188
|
0
|
0
|
0
|
|
|
0
|
&& ( do { local $_ = $k; /\A[^\W0-9]\w*\z/ } ) |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
189
|
|
|
|
|
|
|
); |
|
190
|
|
|
|
|
|
|
}; |
|
191
|
0
|
|
|
|
|
0
|
$ok; |
|
192
|
|
|
|
|
|
|
} |
|
193
|
|
|
|
|
|
|
} |
|
194
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
|
195
|
|
|
|
|
|
|
"imported_functions", "Map[MethodName,Str]"; |
|
196
|
0
|
|
|
|
|
0
|
$self->{"imported_functions"} = $value; |
|
197
|
|
|
|
|
|
|
}; |
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
# Attribute imported_keywords (type: Map[MethodName,Str]) |
|
200
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 39 |
|
201
|
0
|
|
|
|
|
0
|
do { |
|
202
|
|
|
|
|
|
|
my $value = |
|
203
|
|
|
|
|
|
|
exists( $args->{"imported_keywords"} ) |
|
204
|
0
|
0
|
|
|
|
0
|
? $args->{"imported_keywords"} |
|
205
|
|
|
|
|
|
|
: $self->_build_imported_keywords; |
|
206
|
0
|
0
|
|
|
|
0
|
do { |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
package Mite::Shim; |
|
209
|
0
|
0
|
|
|
|
0
|
( ref($value) eq 'HASH' ) and do { |
|
210
|
0
|
|
|
|
|
0
|
my $ok = 1; |
|
211
|
0
|
|
|
|
|
0
|
for my $v ( values %{$value} ) { |
|
|
0
|
|
|
|
|
0
|
|
|
212
|
0
|
0
|
|
|
|
0
|
( $ok = 0, last ) unless do { |
|
213
|
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
package Mite::Shim; |
|
215
|
0
|
0
|
|
|
|
0
|
defined($v) and do { |
|
216
|
0
|
0
|
|
|
|
0
|
ref( \$v ) eq 'SCALAR' |
|
217
|
|
|
|
|
|
|
or ref( \( my $val = $v ) ) eq 'SCALAR'; |
|
218
|
|
|
|
|
|
|
} |
|
219
|
|
|
|
|
|
|
} |
|
220
|
|
|
|
|
|
|
}; |
|
221
|
0
|
|
|
|
|
0
|
for my $k ( keys %{$value} ) { |
|
|
0
|
|
|
|
|
0
|
|
|
222
|
|
|
|
|
|
|
( $ok = 0, last ) |
|
223
|
|
|
|
|
|
|
unless ( |
|
224
|
|
|
|
|
|
|
( |
|
225
|
|
|
|
|
|
|
do { |
|
226
|
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
package Mite::Shim; |
|
228
|
0
|
0
|
|
|
|
0
|
defined($k) and do { |
|
229
|
0
|
0
|
|
|
|
0
|
ref( \$k ) eq 'SCALAR' |
|
230
|
|
|
|
|
|
|
or ref( \( my $val = $k ) ) eq |
|
231
|
|
|
|
|
|
|
'SCALAR'; |
|
232
|
|
|
|
|
|
|
} |
|
233
|
|
|
|
|
|
|
} |
|
234
|
|
|
|
|
|
|
) |
|
235
|
0
|
0
|
0
|
|
|
0
|
&& ( do { local $_ = $k; /\A[^\W0-9]\w*\z/ } ) |
|
|
0
|
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
0
|
|
|
236
|
|
|
|
|
|
|
); |
|
237
|
|
|
|
|
|
|
}; |
|
238
|
0
|
|
|
|
|
0
|
$ok; |
|
239
|
|
|
|
|
|
|
} |
|
240
|
|
|
|
|
|
|
} |
|
241
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
|
242
|
|
|
|
|
|
|
"imported_keywords", "Map[MethodName,Str]"; |
|
243
|
0
|
|
|
|
|
0
|
$self->{"imported_keywords"} = $value; |
|
244
|
|
|
|
|
|
|
}; |
|
245
|
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
# Attribute arg |
|
247
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 41 |
|
248
|
0
|
0
|
|
|
|
0
|
$self->{"arg"} = ( exists( $args->{"arg"} ) ? $args->{"arg"} : {} ); |
|
249
|
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
# Call BUILD methods |
|
251
|
0
|
0
|
0
|
|
|
0
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
|
|
0
|
0
|
|
|
|
0
|
|
|
252
|
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
# Unrecognized parameters |
|
254
|
|
|
|
|
|
|
my @unknown = grep not( |
|
255
|
|
|
|
|
|
|
/\A(?:arg|imported_(?:functions|keywords)|name|s(?:him_name|ource))\z/ |
|
256
|
0
|
|
|
|
|
0
|
), keys %{$args}; |
|
|
0
|
|
|
|
|
0
|
|
|
257
|
|
|
|
|
|
|
@unknown |
|
258
|
0
|
0
|
|
|
|
0
|
and croak( |
|
259
|
|
|
|
|
|
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
260
|
|
|
|
|
|
|
|
|
261
|
0
|
|
|
|
|
0
|
return $self; |
|
262
|
|
|
|
|
|
|
} |
|
263
|
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
|
265
|
|
|
|
|
|
|
sub BUILDALL { |
|
266
|
155
|
|
|
155
|
0
|
711
|
my $class = ref( $_[0] ); |
|
267
|
155
|
|
33
|
|
|
789
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
|
268
|
155
|
50
|
|
|
|
431
|
$_->(@_) for @{ $meta->{BUILD} || [] }; |
|
|
155
|
|
|
|
|
1406
|
|
|
269
|
|
|
|
|
|
|
} |
|
270
|
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
|
272
|
|
|
|
|
|
|
sub DESTROY { |
|
273
|
5
|
|
|
5
|
|
39
|
my $self = shift; |
|
274
|
5
|
|
33
|
|
|
30
|
my $class = ref($self) || $self; |
|
275
|
5
|
|
33
|
|
|
23
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
|
276
|
5
|
50
|
|
|
|
28
|
my $in_global_destruction = |
|
277
|
|
|
|
|
|
|
defined ${^GLOBAL_PHASE} |
|
278
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
|
279
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
|
280
|
5
|
50
|
|
|
|
13
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
|
|
5
|
|
|
|
|
28
|
|
|
281
|
0
|
|
|
|
|
0
|
my $e = do { |
|
282
|
0
|
|
|
|
|
0
|
local ( $?, $@ ); |
|
283
|
0
|
|
|
|
|
0
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
|
|
0
|
|
|
|
|
0
|
|
|
284
|
0
|
|
|
|
|
0
|
$@; |
|
285
|
|
|
|
|
|
|
}; |
|
286
|
109
|
|
|
109
|
|
1138
|
no warnings 'misc'; # avoid (in cleanup) warnings |
|
|
109
|
|
|
|
|
320
|
|
|
|
109
|
|
|
|
|
121130
|
|
|
287
|
0
|
0
|
|
|
|
0
|
die $e if $e; # rethrow |
|
288
|
|
|
|
|
|
|
} |
|
289
|
5
|
|
|
|
|
41
|
return; |
|
290
|
|
|
|
|
|
|
} |
|
291
|
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} |
|
293
|
|
|
|
|
|
|
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
|
294
|
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
# Accessors for arg |
|
296
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 41 |
|
297
|
|
|
|
|
|
|
if ($__XS) { |
|
298
|
|
|
|
|
|
|
Class::XSAccessor->import( |
|
299
|
|
|
|
|
|
|
chained => 1, |
|
300
|
|
|
|
|
|
|
"accessors" => { "arg" => "arg" }, |
|
301
|
|
|
|
|
|
|
); |
|
302
|
|
|
|
|
|
|
} |
|
303
|
|
|
|
|
|
|
else { |
|
304
|
|
|
|
|
|
|
*arg = sub { |
|
305
|
|
|
|
|
|
|
@_ > 1 ? do { $_[0]{"arg"} = $_[1]; $_[0]; } : ( $_[0]{"arg"} ); |
|
306
|
|
|
|
|
|
|
}; |
|
307
|
|
|
|
|
|
|
} |
|
308
|
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
# Accessors for imported_functions |
|
310
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 34 |
|
311
|
|
|
|
|
|
|
if ($__XS) { |
|
312
|
|
|
|
|
|
|
Class::XSAccessor->import( |
|
313
|
|
|
|
|
|
|
chained => 1, |
|
314
|
|
|
|
|
|
|
"getters" => { "imported_functions" => "imported_functions" }, |
|
315
|
|
|
|
|
|
|
); |
|
316
|
|
|
|
|
|
|
} |
|
317
|
|
|
|
|
|
|
else { |
|
318
|
|
|
|
|
|
|
*imported_functions = sub { |
|
319
|
|
|
|
|
|
|
@_ == 1 |
|
320
|
|
|
|
|
|
|
or croak( |
|
321
|
|
|
|
|
|
|
'Reader "imported_functions" usage: $self->imported_functions()' |
|
322
|
|
|
|
|
|
|
); |
|
323
|
|
|
|
|
|
|
$_[0]{"imported_functions"}; |
|
324
|
|
|
|
|
|
|
}; |
|
325
|
|
|
|
|
|
|
} |
|
326
|
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
# Accessors for imported_keywords |
|
328
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 39 |
|
329
|
|
|
|
|
|
|
if ($__XS) { |
|
330
|
|
|
|
|
|
|
Class::XSAccessor->import( |
|
331
|
|
|
|
|
|
|
chained => 1, |
|
332
|
|
|
|
|
|
|
"getters" => { "imported_keywords" => "imported_keywords" }, |
|
333
|
|
|
|
|
|
|
); |
|
334
|
|
|
|
|
|
|
} |
|
335
|
|
|
|
|
|
|
else { |
|
336
|
|
|
|
|
|
|
*imported_keywords = sub { |
|
337
|
|
|
|
|
|
|
@_ == 1 |
|
338
|
|
|
|
|
|
|
or croak( |
|
339
|
|
|
|
|
|
|
'Reader "imported_keywords" usage: $self->imported_keywords()'); |
|
340
|
|
|
|
|
|
|
$_[0]{"imported_keywords"}; |
|
341
|
|
|
|
|
|
|
}; |
|
342
|
|
|
|
|
|
|
} |
|
343
|
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
# Accessors for name |
|
345
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 11 |
|
346
|
|
|
|
|
|
|
if ($__XS) { |
|
347
|
|
|
|
|
|
|
Class::XSAccessor->import( |
|
348
|
|
|
|
|
|
|
chained => 1, |
|
349
|
|
|
|
|
|
|
"getters" => { "name" => "name" }, |
|
350
|
|
|
|
|
|
|
); |
|
351
|
|
|
|
|
|
|
} |
|
352
|
|
|
|
|
|
|
else { |
|
353
|
|
|
|
|
|
|
*name = sub { |
|
354
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "name" usage: $self->name()'); |
|
355
|
|
|
|
|
|
|
$_[0]{"name"}; |
|
356
|
|
|
|
|
|
|
}; |
|
357
|
|
|
|
|
|
|
} |
|
358
|
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
# Accessors for shim_name |
|
360
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 23 |
|
361
|
|
|
|
|
|
|
sub shim_name { |
|
362
|
|
|
|
|
|
|
@_ > 1 |
|
363
|
|
|
|
|
|
|
? do { |
|
364
|
|
|
|
|
|
|
( |
|
365
|
|
|
|
|
|
|
( |
|
366
|
|
|
|
|
|
|
do { |
|
367
|
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
package Mite::Shim; |
|
369
|
117
|
50
|
|
|
|
640
|
defined( $_[1] ) and do { |
|
370
|
117
|
50
|
|
|
|
1087
|
ref( \$_[1] ) eq 'SCALAR' |
|
371
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq 'SCALAR'; |
|
372
|
|
|
|
|
|
|
} |
|
373
|
|
|
|
|
|
|
} |
|
374
|
|
|
|
|
|
|
) |
|
375
|
|
|
|
|
|
|
&& ( |
|
376
|
117
|
50
|
33
|
|
|
481
|
do { local $_ = $_[1]; /\A[^\W0-9]\w*(?:::[^\W0-9]\w*)*\z/ } |
|
|
117
|
|
|
|
|
351
|
|
|
|
117
|
|
|
|
|
1143
|
|
|
377
|
|
|
|
|
|
|
) |
|
378
|
|
|
|
|
|
|
) |
|
379
|
|
|
|
|
|
|
or croak( |
|
380
|
|
|
|
|
|
|
"Type check failed in %s: value should be %s", |
|
381
|
|
|
|
|
|
|
"accessor", |
|
382
|
|
|
|
|
|
|
"ValidClassName" |
|
383
|
|
|
|
|
|
|
); |
|
384
|
117
|
|
|
|
|
644
|
$_[0]{"shim_name"} = $_[1]; |
|
385
|
117
|
|
|
|
|
376
|
$_[0]; |
|
386
|
|
|
|
|
|
|
} |
|
387
|
1671
|
100
|
|
1671
|
0
|
4206
|
: do { |
|
388
|
|
|
|
|
|
|
( |
|
389
|
|
|
|
|
|
|
exists( $_[0]{"shim_name"} ) ? $_[0]{"shim_name"} : ( |
|
390
|
1554
|
100
|
|
|
|
10932
|
$_[0]{"shim_name"} = do { |
|
391
|
6
|
|
|
|
|
53
|
my $default_value = $_[0]->_build_shim_name; |
|
392
|
|
|
|
|
|
|
( |
|
393
|
|
|
|
|
|
|
( |
|
394
|
|
|
|
|
|
|
do { |
|
395
|
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
package Mite::Shim; |
|
397
|
6
|
50
|
|
|
|
39
|
defined($default_value) and do { |
|
398
|
6
|
50
|
|
|
|
58
|
ref( \$default_value ) eq 'SCALAR' |
|
399
|
|
|
|
|
|
|
or |
|
400
|
|
|
|
|
|
|
ref( \( my $val = $default_value ) ) |
|
401
|
|
|
|
|
|
|
eq 'SCALAR'; |
|
402
|
|
|
|
|
|
|
} |
|
403
|
|
|
|
|
|
|
} |
|
404
|
|
|
|
|
|
|
) |
|
405
|
|
|
|
|
|
|
&& ( |
|
406
|
6
|
50
|
33
|
|
|
259
|
do { |
|
407
|
6
|
|
|
|
|
17
|
local $_ = $default_value; |
|
408
|
6
|
|
|
|
|
61
|
/\A[^\W0-9]\w*(?:::[^\W0-9]\w*)*\z/; |
|
409
|
|
|
|
|
|
|
} |
|
410
|
|
|
|
|
|
|
) |
|
411
|
|
|
|
|
|
|
) |
|
412
|
|
|
|
|
|
|
or croak( |
|
413
|
|
|
|
|
|
|
"Type check failed in default: %s should be %s", |
|
414
|
|
|
|
|
|
|
"shim_name", |
|
415
|
|
|
|
|
|
|
"ValidClassName" |
|
416
|
|
|
|
|
|
|
); |
|
417
|
6
|
|
|
|
|
35
|
$default_value; |
|
418
|
|
|
|
|
|
|
} |
|
419
|
|
|
|
|
|
|
) |
|
420
|
|
|
|
|
|
|
) |
|
421
|
|
|
|
|
|
|
} |
|
422
|
|
|
|
|
|
|
} |
|
423
|
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
# Accessors for source |
|
425
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Package.pm, line 25 |
|
426
|
|
|
|
|
|
|
sub source { |
|
427
|
|
|
|
|
|
|
@_ > 1 |
|
428
|
|
|
|
|
|
|
? do { |
|
429
|
2
|
50
|
33
|
|
|
20
|
blessed( $_[1] ) && $_[1]->isa("Mite::Source") |
|
430
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
|
431
|
|
|
|
|
|
|
"accessor", "Mite::Source" ); |
|
432
|
2
|
|
|
|
|
8
|
$_[0]{"source"} = $_[1]; |
|
433
|
|
|
|
|
|
|
require Scalar::Util && Scalar::Util::weaken( $_[0]{"source"} ) |
|
434
|
2
|
50
|
33
|
|
|
24
|
if ref $_[0]{"source"}; |
|
435
|
2
|
|
|
|
|
5
|
$_[0]; |
|
436
|
|
|
|
|
|
|
} |
|
437
|
1156
|
100
|
|
1156
|
0
|
5536
|
: ( $_[0]{"source"} ); |
|
438
|
|
|
|
|
|
|
} |
|
439
|
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
# See UNIVERSAL |
|
441
|
|
|
|
|
|
|
sub DOES { |
|
442
|
0
|
|
|
0
|
0
|
|
my ( $self, $role ) = @_; |
|
443
|
0
|
|
|
|
|
|
our %DOES; |
|
444
|
0
|
0
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
|
445
|
0
|
0
|
|
|
|
|
return 1 if $role eq __PACKAGE__; |
|
446
|
0
|
0
|
0
|
|
|
|
if ( $INC{'Moose/Util.pm'} |
|
|
|
|
0
|
|
|
|
|
|
447
|
|
|
|
|
|
|
and my $meta = Moose::Util::find_meta( ref $self or $self ) ) |
|
448
|
|
|
|
|
|
|
{ |
|
449
|
0
|
0
|
0
|
|
|
|
$meta->can('does_role') and $meta->does_role($role) and return 1; |
|
450
|
|
|
|
|
|
|
} |
|
451
|
0
|
|
|
|
|
|
return $self->SUPER::DOES($role); |
|
452
|
|
|
|
|
|
|
} |
|
453
|
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
|
455
|
|
|
|
|
|
|
sub does { |
|
456
|
0
|
|
|
0
|
0
|
|
shift->DOES(@_); |
|
457
|
|
|
|
|
|
|
} |
|
458
|
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
1; |
|
460
|
|
|
|
|
|
|
} |