line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Mite::Compiled; |
4
|
107
|
|
|
107
|
|
976
|
use strict; |
|
107
|
|
|
|
|
345
|
|
|
107
|
|
|
|
|
3805
|
|
5
|
107
|
|
|
107
|
|
718
|
use warnings; |
|
107
|
|
|
|
|
340
|
|
|
107
|
|
|
|
|
3619
|
|
6
|
107
|
|
|
107
|
|
1395
|
no warnings qw( once void ); |
|
107
|
|
|
|
|
369
|
|
|
107
|
|
|
|
|
12936
|
|
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
|
107
|
|
|
107
|
|
13849
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "Mite::Compiled" ); |
15
|
|
|
|
|
|
|
( |
16
|
|
|
|
|
|
|
*after, *around, *before, *extends, *field, |
17
|
|
|
|
|
|
|
*has, *param, *signature_for, *with |
18
|
|
|
|
|
|
|
) |
19
|
107
|
|
|
|
|
865
|
= do { |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
package Mite::Shim; |
22
|
107
|
|
|
107
|
|
766
|
no warnings 'redefine'; |
|
107
|
|
|
|
|
287
|
|
|
107
|
|
|
|
|
25993
|
|
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
|
214
|
|
|
214
|
|
3272
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
30
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) }, |
31
|
107
|
|
|
107
|
|
1563
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
32
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
33
|
107
|
|
|
|
|
21743
|
); |
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Mite imports |
38
|
|
|
|
|
|
|
BEGIN { |
39
|
107
|
|
|
107
|
|
857
|
require Scalar::Util; |
40
|
107
|
|
|
|
|
478
|
*STRICT = \&Mite::Shim::STRICT; |
41
|
107
|
|
|
|
|
388
|
*bare = \&Mite::Shim::bare; |
42
|
107
|
|
|
|
|
338
|
*blessed = \&Scalar::Util::blessed; |
43
|
107
|
|
|
|
|
422
|
*carp = \&Mite::Shim::carp; |
44
|
107
|
|
|
|
|
319
|
*confess = \&Mite::Shim::confess; |
45
|
107
|
|
|
|
|
297
|
*croak = \&Mite::Shim::croak; |
46
|
107
|
|
|
|
|
269
|
*false = \&Mite::Shim::false; |
47
|
107
|
|
|
|
|
314
|
*guard = \&Mite::Shim::guard; |
48
|
107
|
|
|
|
|
281
|
*lazy = \&Mite::Shim::lazy; |
49
|
107
|
|
|
|
|
286
|
*lock = \&Mite::Shim::lock; |
50
|
107
|
|
|
|
|
330
|
*ro = \&Mite::Shim::ro; |
51
|
107
|
|
|
|
|
274
|
*rw = \&Mite::Shim::rw; |
52
|
107
|
|
|
|
|
265
|
*rwp = \&Mite::Shim::rwp; |
53
|
107
|
|
|
|
|
261
|
*true = \&Mite::Shim::true; |
54
|
107
|
|
|
|
|
4144
|
*unlock = \&Mite::Shim::unlock; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# Gather metadata for constructor and destructor |
58
|
|
|
|
|
|
|
sub __META__ { |
59
|
107
|
|
|
107
|
|
838
|
no strict 'refs'; |
|
107
|
|
|
|
|
376
|
|
|
107
|
|
|
|
|
36095
|
|
60
|
83
|
|
|
83
|
|
293
|
my $class = shift; |
61
|
83
|
|
33
|
|
|
665
|
$class = ref($class) || $class; |
62
|
83
|
|
|
|
|
633
|
my $linear_isa = mro::get_linear_isa($class); |
63
|
|
|
|
|
|
|
return { |
64
|
|
|
|
|
|
|
BUILD => [ |
65
|
83
|
50
|
|
|
|
244
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
83
|
|
|
|
|
984
|
|
|
0
|
|
|
|
|
0
|
|
66
|
83
|
|
|
|
|
569
|
map { "$_\::BUILD" } reverse @$linear_isa |
67
|
|
|
|
|
|
|
], |
68
|
|
|
|
|
|
|
DEMOLISH => [ |
69
|
83
|
50
|
|
|
|
209
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
83
|
|
|
|
|
2113
|
|
|
0
|
|
|
|
|
0
|
|
70
|
83
|
|
|
|
|
424
|
map { "$_\::DEMOLISH" } @$linear_isa |
|
83
|
|
|
|
|
472
|
|
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
|
91
|
50
|
|
91
|
0
|
475
|
my $class = ref( $_[0] ) ? ref(shift) : shift; |
80
|
91
|
|
66
|
|
|
997
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
81
|
91
|
|
|
|
|
390
|
my $self = bless {}, $class; |
82
|
|
|
|
|
|
|
my $args = |
83
|
|
|
|
|
|
|
$meta->{HAS_BUILDARGS} |
84
|
|
|
|
|
|
|
? $class->BUILDARGS(@_) |
85
|
91
|
50
|
|
|
|
964
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
|
0
|
50
|
|
|
|
0
|
|
86
|
91
|
|
|
|
|
324
|
my $no_build = delete $args->{__no_BUILD__}; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# Attribute file (type: Path) |
89
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Compiled.pm, line 23 |
90
|
91
|
50
|
|
|
|
449
|
if ( exists $args->{"file"} ) { |
91
|
0
|
|
|
|
|
0
|
do { |
92
|
0
|
|
|
|
|
0
|
my $coerced_value = do { |
93
|
0
|
|
|
|
|
0
|
my $to_coerce = $args->{"file"}; |
94
|
|
|
|
|
|
|
( |
95
|
|
|
|
|
|
|
( |
96
|
|
|
|
|
|
|
do { |
97
|
107
|
|
|
107
|
|
888
|
use Scalar::Util (); |
|
107
|
|
|
|
|
308
|
|
|
107
|
|
|
|
|
77088
|
|
98
|
0
|
0
|
|
|
|
0
|
Scalar::Util::blessed($to_coerce) |
99
|
|
|
|
|
|
|
and $to_coerce->isa(q[Path::Tiny]); |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
) |
102
|
|
|
|
|
|
|
) ? $to_coerce : ( |
103
|
|
|
|
|
|
|
do { |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
package Mite::Shim; |
106
|
0
|
0
|
|
|
|
0
|
defined($to_coerce) and do { |
107
|
0
|
0
|
|
|
|
0
|
ref( \$to_coerce ) eq 'SCALAR' |
108
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq |
109
|
|
|
|
|
|
|
'SCALAR'; |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
) |
113
|
|
|
|
|
|
|
? scalar( |
114
|
0
|
|
|
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
|
0
|
|
|
|
|
0
|
|
115
|
|
|
|
|
|
|
) |
116
|
|
|
|
|
|
|
: ( |
117
|
|
|
|
|
|
|
do { |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
package Mite::Shim; |
120
|
|
|
|
|
|
|
defined($to_coerce) && !ref($to_coerce) |
121
|
|
|
|
|
|
|
or Scalar::Util::blessed($to_coerce) && ( |
122
|
|
|
|
|
|
|
sub { |
123
|
0
|
|
|
0
|
|
0
|
require overload; |
124
|
0
|
0
|
0
|
|
|
0
|
overload::Overloaded( ref $_[0] or $_[0] ) |
|
|
|
0
|
|
|
|
|
125
|
|
|
|
|
|
|
and |
126
|
|
|
|
|
|
|
overload::Method( ( ref $_[0] or $_[0] ), |
127
|
|
|
|
|
|
|
$_[1] ); |
128
|
|
|
|
|
|
|
} |
129
|
0
|
0
|
0
|
|
|
0
|
)->( $to_coerce, q[""] ); |
|
|
|
0
|
|
|
|
|
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
) |
132
|
|
|
|
|
|
|
? scalar( |
133
|
0
|
|
|
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
|
0
|
|
|
|
|
0
|
|
134
|
|
|
|
|
|
|
) |
135
|
|
|
|
|
|
|
: ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
136
|
0
|
0
|
|
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path(@$_) } |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
|
137
|
|
|
|
|
|
|
) |
138
|
|
|
|
|
|
|
: $to_coerce; |
139
|
|
|
|
|
|
|
}; |
140
|
0
|
0
|
0
|
|
|
0
|
blessed($coerced_value) && $coerced_value->isa("Path::Tiny") |
141
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
142
|
|
|
|
|
|
|
"file", "Path"; |
143
|
0
|
|
|
|
|
0
|
$self->{"file"} = $coerced_value; |
144
|
|
|
|
|
|
|
}; |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
# Attribute source (type: Mite::Source) |
148
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Compiled.pm, line 25 |
149
|
|
|
|
|
|
|
croak "Missing key in constructor: source" |
150
|
91
|
50
|
|
|
|
550
|
unless exists $args->{"source"}; |
151
|
91
|
50
|
33
|
|
|
1656
|
blessed( $args->{"source"} ) && $args->{"source"}->isa("Mite::Source") |
152
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
153
|
|
|
|
|
|
|
"source", "Mite::Source"; |
154
|
91
|
|
|
|
|
711
|
$self->{"source"} = $args->{"source"}; |
155
|
|
|
|
|
|
|
require Scalar::Util && Scalar::Util::weaken( $self->{"source"} ) |
156
|
91
|
50
|
33
|
|
|
1584
|
if ref $self->{"source"}; |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
# Call BUILD methods |
159
|
91
|
50
|
33
|
|
|
644
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
|
91
|
50
|
|
|
|
765
|
|
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
# Unrecognized parameters |
162
|
91
|
|
|
|
|
319
|
my @unknown = grep not(/\A(?:file|source)\z/), keys %{$args}; |
|
91
|
|
|
|
|
1105
|
|
163
|
|
|
|
|
|
|
@unknown |
164
|
91
|
50
|
|
|
|
505
|
and croak( |
165
|
|
|
|
|
|
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
166
|
|
|
|
|
|
|
|
167
|
91
|
|
|
|
|
568
|
return $self; |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
171
|
|
|
|
|
|
|
sub BUILDALL { |
172
|
0
|
|
|
0
|
0
|
0
|
my $class = ref( $_[0] ); |
173
|
0
|
|
0
|
|
|
0
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
174
|
0
|
0
|
|
|
|
0
|
$_->(@_) for @{ $meta->{BUILD} || [] }; |
|
0
|
|
|
|
|
0
|
|
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
178
|
|
|
|
|
|
|
sub DESTROY { |
179
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
180
|
0
|
|
0
|
|
|
0
|
my $class = ref($self) || $self; |
181
|
0
|
|
0
|
|
|
0
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
182
|
0
|
0
|
|
|
|
0
|
my $in_global_destruction = |
183
|
|
|
|
|
|
|
defined ${^GLOBAL_PHASE} |
184
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
185
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
186
|
0
|
0
|
|
|
|
0
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
|
0
|
|
|
|
|
0
|
|
187
|
0
|
|
|
|
|
0
|
my $e = do { |
188
|
0
|
|
|
|
|
0
|
local ( $?, $@ ); |
189
|
0
|
|
|
|
|
0
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
|
0
|
|
|
|
|
0
|
|
190
|
0
|
|
|
|
|
0
|
$@; |
191
|
|
|
|
|
|
|
}; |
192
|
107
|
|
|
107
|
|
989
|
no warnings 'misc'; # avoid (in cleanup) warnings |
|
107
|
|
|
|
|
534
|
|
|
107
|
|
|
|
|
15047
|
|
193
|
0
|
0
|
|
|
|
0
|
die $e if $e; # rethrow |
194
|
|
|
|
|
|
|
} |
195
|
0
|
|
|
|
|
0
|
return; |
196
|
|
|
|
|
|
|
} |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} |
199
|
|
|
|
|
|
|
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
# Accessors for file |
202
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Compiled.pm, line 23 |
203
|
|
|
|
|
|
|
sub file { |
204
|
|
|
|
|
|
|
@_ > 1 |
205
|
|
|
|
|
|
|
? do { |
206
|
0
|
|
|
|
|
0
|
my $value = do { |
207
|
0
|
|
|
|
|
0
|
my $to_coerce = $_[1]; |
208
|
|
|
|
|
|
|
( |
209
|
|
|
|
|
|
|
( |
210
|
|
|
|
|
|
|
do { |
211
|
107
|
|
|
107
|
|
939
|
use Scalar::Util (); |
|
107
|
|
|
|
|
439
|
|
|
107
|
|
|
|
|
38289
|
|
212
|
0
|
0
|
|
|
|
0
|
Scalar::Util::blessed($to_coerce) |
213
|
|
|
|
|
|
|
and $to_coerce->isa(q[Path::Tiny]); |
214
|
|
|
|
|
|
|
} |
215
|
|
|
|
|
|
|
) |
216
|
|
|
|
|
|
|
) ? $to_coerce : ( |
217
|
|
|
|
|
|
|
do { |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
package Mite::Shim; |
220
|
0
|
0
|
|
|
|
0
|
defined($to_coerce) and do { |
221
|
0
|
0
|
|
|
|
0
|
ref( \$to_coerce ) eq 'SCALAR' |
222
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq 'SCALAR'; |
223
|
|
|
|
|
|
|
} |
224
|
|
|
|
|
|
|
} |
225
|
|
|
|
|
|
|
) |
226
|
|
|
|
|
|
|
? scalar( |
227
|
0
|
|
|
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
|
0
|
|
|
|
|
0
|
|
228
|
|
|
|
|
|
|
) |
229
|
|
|
|
|
|
|
: ( |
230
|
|
|
|
|
|
|
do { |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
package Mite::Shim; |
233
|
|
|
|
|
|
|
defined($to_coerce) && !ref($to_coerce) |
234
|
|
|
|
|
|
|
or Scalar::Util::blessed($to_coerce) && ( |
235
|
|
|
|
|
|
|
sub { |
236
|
0
|
|
|
0
|
|
0
|
require overload; |
237
|
0
|
0
|
0
|
|
|
0
|
overload::Overloaded( ref $_[0] or $_[0] ) |
|
|
|
0
|
|
|
|
|
238
|
|
|
|
|
|
|
and overload::Method( ( ref $_[0] or $_[0] ), |
239
|
|
|
|
|
|
|
$_[1] ); |
240
|
|
|
|
|
|
|
} |
241
|
0
|
0
|
0
|
|
|
0
|
)->( $to_coerce, q[""] ); |
|
|
|
0
|
|
|
|
|
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
) |
244
|
|
|
|
|
|
|
? scalar( |
245
|
0
|
|
|
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
|
0
|
|
|
|
|
0
|
|
246
|
|
|
|
|
|
|
) |
247
|
|
|
|
|
|
|
: ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
248
|
0
|
0
|
|
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path(@$_) } |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
|
249
|
|
|
|
|
|
|
) |
250
|
|
|
|
|
|
|
: $to_coerce; |
251
|
|
|
|
|
|
|
}; |
252
|
0
|
0
|
0
|
|
|
0
|
blessed($value) && $value->isa("Path::Tiny") |
253
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
254
|
|
|
|
|
|
|
"accessor", "Path" ); |
255
|
0
|
|
|
|
|
0
|
$_[0]{"file"} = $value; |
256
|
0
|
|
|
|
|
0
|
$_[0]; |
257
|
|
|
|
|
|
|
} |
258
|
92
|
50
|
|
92
|
0
|
6293
|
: do { |
259
|
|
|
|
|
|
|
( |
260
|
|
|
|
|
|
|
exists( $_[0]{"file"} ) ? $_[0]{"file"} : ( |
261
|
92
|
100
|
|
|
|
409
|
$_[0]{"file"} = do { |
262
|
89
|
|
|
|
|
216
|
my $default_value = do { |
263
|
89
|
|
|
|
|
497
|
my $to_coerce = |
264
|
|
|
|
|
|
|
$Mite::Compiled::__file_DEFAULT__->( |
265
|
|
|
|
|
|
|
$_[0] ); |
266
|
|
|
|
|
|
|
( |
267
|
|
|
|
|
|
|
( |
268
|
|
|
|
|
|
|
do { |
269
|
107
|
|
|
107
|
|
1093
|
use Scalar::Util (); |
|
107
|
|
|
|
|
378
|
|
|
107
|
|
|
|
|
86756
|
|
270
|
89
|
50
|
|
|
|
803
|
Scalar::Util::blessed($to_coerce) |
271
|
|
|
|
|
|
|
and $to_coerce->isa(q[Path::Tiny]); |
272
|
|
|
|
|
|
|
} |
273
|
|
|
|
|
|
|
) |
274
|
|
|
|
|
|
|
) ? $to_coerce : ( |
275
|
|
|
|
|
|
|
do { |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
package Mite::Shim; |
278
|
89
|
50
|
|
|
|
622
|
defined($to_coerce) and do { |
279
|
89
|
50
|
|
|
|
894
|
ref( \$to_coerce ) eq 'SCALAR' |
280
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) |
281
|
|
|
|
|
|
|
eq 'SCALAR'; |
282
|
|
|
|
|
|
|
} |
283
|
|
|
|
|
|
|
} |
284
|
|
|
|
|
|
|
) |
285
|
|
|
|
|
|
|
? scalar( |
286
|
|
|
|
|
|
|
do { |
287
|
89
|
|
|
|
|
322
|
local $_ = $to_coerce; |
288
|
89
|
|
|
|
|
449
|
Path::Tiny::path($_); |
289
|
|
|
|
|
|
|
} |
290
|
|
|
|
|
|
|
) |
291
|
|
|
|
|
|
|
: ( |
292
|
|
|
|
|
|
|
do { |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
package Mite::Shim; |
295
|
|
|
|
|
|
|
defined($to_coerce) && !ref($to_coerce) |
296
|
|
|
|
|
|
|
or Scalar::Util::blessed($to_coerce) && ( |
297
|
|
|
|
|
|
|
sub { |
298
|
0
|
|
|
0
|
|
0
|
require overload; |
299
|
0
|
0
|
0
|
|
|
0
|
overload::Overloaded( |
|
|
|
0
|
|
|
|
|
300
|
|
|
|
|
|
|
ref $_[0] |
301
|
|
|
|
|
|
|
or $_[0] |
302
|
|
|
|
|
|
|
) |
303
|
|
|
|
|
|
|
and overload::Method( |
304
|
|
|
|
|
|
|
( ref $_[0] or $_[0] ), $_[1] ); |
305
|
|
|
|
|
|
|
} |
306
|
0
|
0
|
0
|
|
|
0
|
)->( $to_coerce, q[""] ); |
|
|
|
0
|
|
|
|
|
307
|
|
|
|
|
|
|
} |
308
|
|
|
|
|
|
|
) |
309
|
|
|
|
|
|
|
? scalar( |
310
|
|
|
|
|
|
|
do { |
311
|
0
|
|
|
|
|
0
|
local $_ = $to_coerce; |
312
|
0
|
|
|
|
|
0
|
Path::Tiny::path($_); |
313
|
|
|
|
|
|
|
} |
314
|
|
|
|
|
|
|
) |
315
|
|
|
|
|
|
|
: ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
316
|
89
|
0
|
|
|
|
881
|
do { |
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
317
|
0
|
|
|
|
|
0
|
local $_ = $to_coerce; |
318
|
0
|
|
|
|
|
0
|
Path::Tiny::path(@$_); |
319
|
|
|
|
|
|
|
} |
320
|
|
|
|
|
|
|
) |
321
|
|
|
|
|
|
|
: $to_coerce; |
322
|
|
|
|
|
|
|
}; |
323
|
89
|
50
|
33
|
|
|
5299
|
blessed($default_value) |
324
|
|
|
|
|
|
|
&& $default_value->isa("Path::Tiny") |
325
|
|
|
|
|
|
|
or croak( |
326
|
|
|
|
|
|
|
"Type check failed in default: %s should be %s", |
327
|
|
|
|
|
|
|
"file", "Path" ); |
328
|
89
|
|
|
|
|
1443
|
$default_value; |
329
|
|
|
|
|
|
|
} |
330
|
|
|
|
|
|
|
) |
331
|
|
|
|
|
|
|
) |
332
|
|
|
|
|
|
|
} |
333
|
|
|
|
|
|
|
} |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
# Accessors for source |
336
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Compiled.pm, line 25 |
337
|
|
|
|
|
|
|
if ($__XS) { |
338
|
|
|
|
|
|
|
Class::XSAccessor->import( |
339
|
|
|
|
|
|
|
chained => 1, |
340
|
|
|
|
|
|
|
"getters" => { "source" => "source" }, |
341
|
|
|
|
|
|
|
); |
342
|
|
|
|
|
|
|
} |
343
|
|
|
|
|
|
|
else { |
344
|
|
|
|
|
|
|
*source = sub { |
345
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "source" usage: $self->source()'); |
346
|
|
|
|
|
|
|
$_[0]{"source"}; |
347
|
|
|
|
|
|
|
}; |
348
|
|
|
|
|
|
|
} |
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
sub _assert_blessed_source { |
351
|
211
|
|
|
211
|
|
399
|
my $object = do { $_[0]{"source"} }; |
|
211
|
|
|
|
|
536
|
|
352
|
211
|
50
|
|
|
|
1043
|
blessed($object) or croak("source is not a blessed object"); |
353
|
211
|
|
|
|
|
1647
|
$object; |
354
|
|
|
|
|
|
|
} |
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
# Delegated methods for source |
357
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Compiled.pm, line 25 |
358
|
88
|
|
|
88
|
0
|
555
|
sub class_order { shift->_assert_blessed_source->class_order(@_) } |
359
|
123
|
|
|
123
|
0
|
487
|
sub classes { shift->_assert_blessed_source->classes(@_) } |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
# See UNIVERSAL |
362
|
|
|
|
|
|
|
sub DOES { |
363
|
0
|
|
|
0
|
0
|
|
my ( $self, $role ) = @_; |
364
|
0
|
|
|
|
|
|
our %DOES; |
365
|
0
|
0
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
366
|
0
|
0
|
|
|
|
|
return 1 if $role eq __PACKAGE__; |
367
|
0
|
0
|
0
|
|
|
|
if ( $INC{'Moose/Util.pm'} |
|
|
|
0
|
|
|
|
|
368
|
|
|
|
|
|
|
and my $meta = Moose::Util::find_meta( ref $self or $self ) ) |
369
|
|
|
|
|
|
|
{ |
370
|
0
|
0
|
0
|
|
|
|
$meta->can('does_role') and $meta->does_role($role) and return 1; |
371
|
|
|
|
|
|
|
} |
372
|
0
|
|
|
|
|
|
return $self->SUPER::DOES($role); |
373
|
|
|
|
|
|
|
} |
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
376
|
|
|
|
|
|
|
sub does { |
377
|
0
|
|
|
0
|
0
|
|
shift->DOES(@_); |
378
|
|
|
|
|
|
|
} |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
# Method signatures |
381
|
|
|
|
|
|
|
our %SIGNATURE_FOR; |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
$SIGNATURE_FOR{"_source_file2compiled_file"} = sub { |
384
|
|
|
|
|
|
|
my $__NEXT__ = shift; |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
my ( %tmp, $tmp, @head ); |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
@_ == 2 |
389
|
|
|
|
|
|
|
or croak( |
390
|
|
|
|
|
|
|
"Wrong number of parameters in signature for %s: got %d, %s", |
391
|
|
|
|
|
|
|
"_source_file2compiled_file", |
392
|
|
|
|
|
|
|
scalar(@_), |
393
|
|
|
|
|
|
|
"expected exactly 2 parameters" |
394
|
|
|
|
|
|
|
); |
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
@head = splice( @_, 0, 1 ); |
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
# Parameter invocant (type: Defined) |
399
|
|
|
|
|
|
|
( defined( $head[0] ) ) |
400
|
|
|
|
|
|
|
or croak( |
401
|
|
|
|
|
|
|
"Type check failed in signature for _source_file2compiled_file: %s should be %s", |
402
|
|
|
|
|
|
|
"\$_[0]", "Defined" |
403
|
|
|
|
|
|
|
); |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
# Parameter $_[0] (type: Defined) |
406
|
|
|
|
|
|
|
( defined( $_[0] ) ) |
407
|
|
|
|
|
|
|
or croak( |
408
|
|
|
|
|
|
|
"Type check failed in signature for _source_file2compiled_file: %s should be %s", |
409
|
|
|
|
|
|
|
"\$_[1]", "Defined" |
410
|
|
|
|
|
|
|
); |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
do { @_ = ( @head, @_ ); goto $__NEXT__ }; |
413
|
|
|
|
|
|
|
}; |
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
1; |
416
|
|
|
|
|
|
|
} |